Page Break on a Condition of a Field


I have created a jasper report that is being currently fed XML data.

Currently, in my header, I have details about the order.  Ex: Order Number, Items in Order, Who ordered it, etc. 

In my Details band, I have data for each Order Line, ex: 5 of this item, 10 of this item, 1 of this.

I need to do a page break on each class of items on an order line... so if 5 Order Lines have a class of Hazmat, they need to be printed together.  And if I have 10 order lines that all have a class of Perishable, they need to be printed together.  

How can I do this?  Thanks ahead of time.

oconnorjohnedward's picture
Joined: Aug 13 2020 - 8:23pm
Last seen: 1 month 3 days ago

1 Answer:


You can group on the [ORDER ITEM] then set the 'Keep Together' property.  If you have a group footer for the [ORDER ITEM] you may also want to set the 'Prevent Orphan Footer' to prevent the footer showing up on the next page due to space available.

Image icon keeptogether.png13.11 KB
jgust's picture
Joined: Jun 10 2010 - 6:39am
Last seen: 1 day 13 hours ago