In jasperreports how to force page break before a

2019-07-31 16:34发布

问题:

Is there a way of forcing a page break before a group title if there is no room for ANY of the subsequent rows? It would be nice to be able to query the amount of space left on the current page.

回答1:

There is a property called min height to start new page you will find on the group header. Make this a sum of the height of your detail row and the group header as the lowest amount (more if you want it to have at least 2 rows of detail). I also suggest setting the Keep Together to true as well.