ilie.cristian.work Posted January 23, 2018 Share Posted January 23, 2018 I have a big report that generate something like 8000 pages. I want to input a limit to maximum page generation. For example to print only the first 100 out of 8000 pages.I've tried to add net.sf.jasperreports.governor.max.pages and net.sf.jasperreports.governor.max.pages.enabled but it throw a exception and not return only first 100 page. Adding for all element Print When Expression PAGE_NUMBER < 100 have some big cons:Need to sum sub-reports page numbersThere are a lot of elements and adding Print When Expression to all of them don't looks goodThanks. Link to comment Share on other sites More sharing options...
hozawa Posted January 23, 2018 Share Posted January 23, 2018 It's not part of the jrxml specification but part of a program that prints the pages.If you develop your own report printing program using JasperReports library, just specify first page to print and last page to print in JasperPrintManager.printPages() method.http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperPrintManager.html#printPages-java.io.InputStream-int-int-boolean- Link to comment Share on other sites More sharing options...
ilie.cristian.work Posted January 24, 2018 Author Share Posted January 24, 2018 Is there no other option ? Because I loose a lot of performance generating JRPrint with 8000 pages and only after that to print first 100 pages Link to comment Share on other sites More sharing options...
Solution hozawa Posted January 24, 2018 Solution Share Posted January 24, 2018 If your report pages doesn't have information like total number of pages in them, why not just retrict your data? If you're using sql, you can just set limit and offset. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now