Jump to content
We've recently updated our Privacy Statement, available here ×

How to print Only first N pages in Jasper Report


ilie.cristian.work
Go to solution Solved by hozawa,

Recommended Posts

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. 

PoeqV.png

Adding for all element Print When Expression PAGE_NUMBER < 100 have some big cons:

  1. Need to sum sub-reports page numbers
  2. There are a lot of elements and adding Print When Expression to all of them don't looks good

Thanks.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...