iReport subreport divided by a page break

2019-02-14 15:12发布

The subreport has two Detail bands, the first is "Title" and the second is another subreport. These bands are divided from each other on two pages.

I tried a lot of properties without result as "ignore pagination" and "split allowed"

My question is: How can I force ireport not to split my subreport on two pages ?

I have some screenshots:

The master report:

enter image description here

The subreport:

enter image description here

Another subreport:

enter image description here

The resulting pdf file looks like this:

enter image description here

1条回答
霸刀☆藐视天下
2楼-- · 2019-02-14 15:31

Instead of using two bands in the principle subreport, put the title and the second subreport into the same band. Then set the splitType for that single band to "Prevent". That way, the title and data will be kept together and the split will happen before the title if the data will not fit on the page.

Edit - Preventing the title from repeating:

Putting the title into the detail band will make it repeat with each set of data. To prevent this, change the printWhenExpression to $V{REPORT_COUNT} == 1. This will cause it to be printed only once, for the first record, and not for each subsequent loop through the datasource.

查看更多
登录 后发表回答