danoldenkampgmail.com Posted September 13, 2019 Share Posted September 13, 2019 Hi Guys,User Jaspersoft studio I have a table report of Sales Reps and their sales orders.I would like page breaks groups by the first column (Sales Reps) so it prints a seperate sheet for each sales rep. Is a group the best way to accomplish a page break based on a field?I read the groups wiki:https://community.jaspersoft.com/wiki/groupsBut I don't really understand how to make grouping work with tables. Seems like groups only work with the root dataset, but when I create a table it forces me to do a new dataset. Thank you for your suggestions. Link to comment Share on other sites More sharing options...
C-Box Posted September 16, 2019 Share Posted September 16, 2019 Hi Dan,I would use a group for the "outer" sales rep and set the flag "StartOnNewPage" to true. So each new grouping expression value will automatically create a pagebreak.For "inner" records you could then use a SubDataSet for a table component or even a subReport. So this is - so my opinion - the easiest way for separating pages depending on a changed value.When I remember right, the table component uses an own dataset, as it iterates itself through the records. You can't mix it with the main query, because then two elements would step through your records. You can use the main dataset in the title/summary band to use it within a table component, so that the dataset will iterate just once. But using it in detail or at group level will cause conflicts while stepping from one record to the next one.hth + regardsC-Box Link to comment Share on other sites More sharing options...
danoldenkampgmail.com Posted September 16, 2019 Author Share Posted September 16, 2019 Thank you!I see that groups can be nested under groups similiar to SQL Report Writer. I set one group to be the Sales Rep with each on a new page.The other group was by sales orders and the details had the line items.Perfect! Thank you! 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