Hello everybody
I am trying to use the COUNT-function but without success. I was not able to find anything function-related in the user manual. What is the correct syntax? What is the purpose of the "DataBand"-Parameter? Is it the band where the query is located in? Or the band the result is displayed? Or the target band where the amount should be displayed?
My goal: I want to output a list of serials in a text field AND display the amount of serials in a different text field.
Displaying the serials works fine by using "$D{production_order.SERIAL}" in a text field.
My SQL-statement of "production_order"
SELECT serial
FROM orders
WHERE orderId = $D{orders.id}
I want to display the amount of serial numbers without invoking a second SQL-statement with "Select count(*) ...".
I watched the video on limereport.ru and and adjusted my command to the syntax shown in the video.
$S{COUNT("$D{production_order.SERIAL}","DataBand1")}
But I get:
SyntaxError: Parse error
I tried a lot and tested to omit some of the quotation marks as I seen it in some other forum posts. I also tried different DataBands, but it did not help. If I omit the quotation marks completely:
$S{COUNT($D{production_order.SERIAL},DataBand1)}
I get:
Function COUNT not found or have wrong arguments
What am I doing wrong? Or is there another way to achieve my goal, maybe by using custom scripts/functions?
I am using version 1.4.49
Thanks in advance