Orphan prevention?

By: Steve Cohen - stevecoh2
Orphan prevention?
2004-04-05 14:16
My report contains groups that may extend over several pages, as well as groups that may consist of as little as one detail row and one group footer row.

I would like to ensure that a group smaller than a certain size should never be split without forcing a page break on every group. We should never see a single detail row at the bottom of one page and its group footer at the top the next page. I've tried playing with
group.minHeightToStartNewPage and with detail.band.isSplitAllowed and neither seems to work.

Is there a way to make jasper do what I want it to? I can't have been the first to ask for this, but I've been through the docs and nothing there looks like it helps me.

By: Teodor Danciu - teodord
RE: Orphan prevention?
2004-04-17 04:40


I think "minHeightToStartNewPage" can prevent
small groups from starting at the bottom of the page
if there is too little space for the group footer to fit
also on the current page.
For example, if I would want to have groups with
less than 5 rows always printed on a new page
I there is not enough space I would make
"minHeightToStartNewPage" to be at least
5 * detail.height + groupfooter.height

However, if you are talking about large or medium
sized groups for which the groups footer gets
printed alone on the next page, then you are right.

The only solution in this case is to know beforehand
how many rows are in the group. Only if we know
how many rows are left in the group ca we prevent
orphans unsing a special trick.
The number of rows in the group could be part of
the data source if you make you query calculate it
before passing the data to the report filling routines.


I hope this helps.
ktrinad's picture
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet