How to insert a page break in JasperReport

Johannes Templ picture Johannes Templ · Nov 9, 2011 · Viewed 69.5k times · Source

I have a JasperReports template, with a filled detail band.

If I run the report, I have a page count of 27 (27 detail rows)

I want that detail row number 12 begins with a new page, so I have to insert a pagebreak after pagecount 11.

But I cannot find the element "pagebreak" - What is it called in Jasper?

The 2nd question:

Is it also possible to modify the format (font, size,....) of each detail-row?

For example: pagecount 1 - detail row is printed in sansSerif font size 10, pagecount 2 - detail row is printed in Serif font size 12 (bold) and so on.....

The 3rd question:

Is it possible to insert a tabulator in a string?

For example:

"Name:" + + "Hannes" + " \n" +

"City:" + " " + "New York"

-->so Hannes and New York should be placed on the same position (same space from the left side)

Answer

wannik picture wannik · Nov 9, 2011

Answer to your 1st question:

  • Drag Break to Detail band. Choose Page Break.
  • Set its property Print When Expression to $V{PAGE_COUNT}==11