How to insert a page break in JasperReport

我们两清 提交于 2020-04-07 17:42:09

问题


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)


回答1:


Answer to your 1st question:

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



回答2:


  1. It's called "Break". It's the first item in the tool palette in iReport.
  2. Sort of. Yes, you can use styled text and change fonts and sizes and colors dynamically. But generally the point of having a detail row is that all things in it look identical. To style the detail band differently on different pages you should be using subreports or tables.
  3. Yes. Use "\t". It's a recent feature, so you won't see it if your version is too old.


来源:https://stackoverflow.com/questions/8069462/how-to-insert-a-page-break-in-jasperreport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!