Counting Jasper reports on a new page

I have a jasper report consisting of 6 subscriptions. Each of these subheadings has its own heading section. Now I need each report to start on a new page. I tried to add page breaks, but this did not work for me.

While investigating the problem, I fist with a trick to set isTitleNewPage to true at http://www.dzone.com/snippets/jasperreports-subreport-new . So I added the attribute isTitleNewPage="true" to all the subheadings, but now the sub-report heading remains on the previous page, and the details and summary of this sub-register are displayed on the new page.

How can I solve this problem?

+4
source share
4 answers

The simplest solution is to set the runToBottom flag to true in the subreport tags.

 <subreport runToBottom="true"> 

This causes the subreport to fill out the entire page, so the next report below will start on a new page.

The isTitleNewPage flag isTitleNewPage not do the trick because, as you have noticed, it will split the sub-report title group with the rest of the sub-report content (unless you use an empty title bar).

+1
source

I had the same problem as the title on the previous page.

But I have a solution:

  • put the material from the title in the page title bar
  • set isTitleNewPage = "true"
  • add the Integer variable to the subreport with the initial value 0
  • draft page
  • expression $ V {vari} + 1
  • print when the page title expression is $ V {vari} == 0

You now have a title on a new page, but only once.

0
source

My solution to this problem is to add each Subreport to a separate "Detailed Range" and then set the height of the range to the maximum possible value (right-click on "Detail X Band" => "Maximize Band Height"). Between groups it was possible to print several blank pages, but this is not a big problem in my case.

0
source

In the start tag:

 <jasperReport 

set:

 isTitleNewPage="true" 

isTitleNewPage

0
source

All Articles