Is there a way to set the starting page number in JasperReports?

孤人 提交于 2019-12-11 04:08:28

问题


I have a reporting system where occasionally there will be multiple JasperReports in a row (e.g. a regular report, and an index report at the end). If the regular report is 21 pages long, then I need the subsequent report to start on page 22.

Is there a simple way to tell a JasperReport what page number to start on? I can do this in a roundabout way, but I feel like I am overlooking something simple. Google and Bing searches have not yielded any answers for me. Thanks for any help you can offer.


回答1:


No, there's no feature to say, "Start on page N."

But it doesn't seem that it would be too roundabout to just add a parameter $P{FirstPageNumber}. Then in the field where you would normally use the expression $V{PAGE_NUMBER}, you would instead use $V{PAGE_NUMBER} + $P{FirstPageNumber}.




回答2:


use "Page "+ $V{PAGE_NUMBER}.lowestOneBit( 1 )



来源:https://stackoverflow.com/questions/8714165/is-there-a-way-to-set-the-starting-page-number-in-jasperreports

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