aggregate functions (count, sum, ...) broken (Jaspersoft Studio 5.5.0.final and 5.5.1.final)?

0

All I actually like to have is a DISTINCT COUNT on a String column field, but it seems to me that all the aggregate functions behave as if they are simulating the "FIRST" functionality.

I can't believe this is broken and it seems more likely I am missing something very strange here.

(I am quite experienced already with JasperReports and worked with BIRT and other reporting frameworks before as well.)

Looking at the docs I can't see where the problem should be: http://www.jasperassistant.com/docs/guide/ch06s08.html

Finally I created the attached simple sample report based on the sample db and updated to the latest 5.5.1.final release without any progress.

Please anybody tell me the secrets I am missing or to my big surprise assure it's a bug indeed crying

Thx

Andreas smiley

as you can see in the report there is just some page header and summary bands, containing the product id/name/cost labels, the name count, cost count, cost sum and all variations of name count increment types (report/column/page/none). the summary band holds the cost sum. the detail band contains just the details.

But none of the aggregate functions shows aggregated data, but only the first(xxx) result it seems. (so strange anyways that the count(name) shows the first rows name instead of a number :-( ).

andreasX's picture
Joined: Nov 8 2013 - 2:31am
Last seen: 2 years 10 months ago

also posted the question here and will keep both up-to-date on important findings: http://stackoverflow.com/questions/22080406/aggregate-functions-count-su...

andreasX - 5 years 11 months ago

added test-report-ext.jrxml where I added some more aggregate fields, arranged it more userfriendly and color-marked corrent/incorrect values.

green - correct (sql-generated) aggregated data

blue - COUNT(ID) in the Summary Band is the only one that seems correct (in the Header Band its incorrect)

red - wrong (Jasper-generated) aggregated data

andreasX - 5 years 11 months ago

also added the result.html (little broken that's why also result.jpg added) to easily see what it outputs for me

andreasX - 5 years 11 months ago

2 Answers:

1

various solutions and obstacles can be found here: http://stackoverflow.com/q/22080406/1915920

andreasX's picture
Joined: Nov 8 2013 - 2:31am
Last seen: 2 years 10 months ago
0

Check if your "Value Class Name" is something like java.lang.Integer instead of the default String

hozawa's picture
56372
Joined: Apr 24 2010 - 4:31pm
Last seen: 7 months 2 weeks ago

removed the original comment since it would be confusing now that this has been clarified in the accepted answer above
(thanks anyways for one partial problem you mentioned!)

andreasX - 5 years 10 months ago

removed the original comment since it would be confusing now that this has been clarified in the accepted answer above

andreasX - 5 years 10 months ago
Feedback