andreasX Posted February 27, 2014 Share Posted February 27, 2014 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.htmlFinally 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 http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/cry_smile.gifThxAndreas http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/regular_smile.gifas 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 :-( ).http://community-static.jaspersoft.com/sites/default/files/questions/test-report-ext-result.jpg Link to comment Share on other sites More sharing options...
andreasX Posted February 27, 2014 Author Share Posted February 27, 2014 also posted the question here and will keep both up-to-date on important findings: http://stackoverflow.com/questions/22080406/aggregate-functions-count-sum-broken-jaspersoft-studio-5-5-0-final-and Link to comment Share on other sites More sharing options...
hozawa Posted February 28, 2014 Share Posted February 28, 2014 Check if your "Value Class Name" is something like java.lang.Integer instead of the default String Link to comment Share on other sites More sharing options...
andreasX Posted February 28, 2014 Author Share Posted February 28, 2014 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 datablue - 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 Link to comment Share on other sites More sharing options...
andreasX Posted February 28, 2014 Author Share Posted February 28, 2014 also added the result.html (little broken that's why also result.jpg added) to easily see what it outputs for me Link to comment Share on other sites More sharing options...
Solution andreasX Posted February 28, 2014 Author Solution Share Posted February 28, 2014 various solutions and obstacles can be found here: http://stackoverflow.com/q/22080406/1915920 Link to comment Share on other sites More sharing options...
andreasX Posted March 11, 2014 Author Share Posted March 11, 2014 removed the original comment since it would be confusing now that this has been clarified in the accepted answer above Link to comment Share on other sites More sharing options...
andreasX Posted March 11, 2014 Author Share Posted March 11, 2014 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!) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now