Jump to content
We've recently updated our Privacy Statement, available here ×

Group a table by a field for page breaks


danoldenkampgmail.com

Recommended Posts

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/groups

But 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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 + regards

C-Box

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...