jcrozier Posted June 23, 2022 Share Posted June 23, 2022 Hello, first time asking a question so hopefully I'm phrasing it all right/providing the right info, etc.. I have a report with a few hundred rows of studies. One of the pieces of information I have about each row (a column in the sql query) is department name. I'd like to create groups based on department_name so that I had a report like this: Cancer Department-One cancer department study-Another cancer department study-Another, etc.. etc... (i.e. all o the cancer department studies) Pediatric Department-Pediatric study 1-Pediatric Study 2-Pediatric Study 3-etc,etc Instead I am getting Cancer Department-A cancer department study-Cancer study 2Pediatric Department-Pediatric study 1Cancer Department-Cancer study 3Pediatric Department-Pediatric Study 2-Pediatric Study 3 I.e. they're being organized under their correct department, but its being broken up a bunch of times for some reason. Any idea why? I could provide the jasper file if helpful. Link to comment Share on other sites More sharing options...
jcrozier Posted June 23, 2022 Author Share Posted June 23, 2022 Turns out I could control it on the SQL end. If I ended the sql query with "order by department_name" it put them all together. Curious if it could have been controlled on the jasper side though Link to comment Share on other sites More sharing options...
erikmarbad Posted June 23, 2022 Share Posted June 23, 2022 This problem can be solved in different ways but it will depend on how your report is made, for example, a way would be following the example offered by the documentation:https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v790/creating-new-reportAlthough the solution of the query is useful, it is always good to know other alternatives (Generally all problems of this style are due to a bad organization of the report) because a query does not always fix the problem. Link to comment Share on other sites More sharing options...
jcrozier Posted June 23, 2022 Author Share Posted June 23, 2022 @erikmarbad in relation to your answer, I dont see in the documentation how to prevent that grouping. I followed the documentation in order to figure out how to group at all. Please point me to where it discusses another way to fix this. Link to comment Share on other sites More sharing options...
Solution jgust Posted June 29, 2022 Solution Share Posted June 29, 2022 @jcrozier>> Curious if it could have been controlled on the jasper side thoughYou will need to add a sort to the report. In other report engines grouping and sorting is one transaction. In Jasper, it is two. With Sorting Without Sorting 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