Jump to content
JasperReports Library 7.0 is now available ×

PDF export is blank with huge data.


Recommended Posts


I am using jasperreports-5.5.2. I have configured JRParameter.IS_IGNORE_PAGINATION as TRUE. When I export the report to PDF, I am getting correct ouput with say few hundreds of records. But, when I export to PDF and there are like thousands of record, I get output as blank PDF. I don't get any error in the background. Not even OutOfMemoryError.

Now, if I turn JRParameter.IS_IGNORE_PAGINATION as FALSE, I can export thousands of records successfully into PDF. Can somebody please tell me what can be a problem?

Here is the snippet of code used for exporting PDF.

ByteArrayOutputStream baos = new ByteArrayOutputStream();  net.sf.jasperreports.engine.JasperPrint jasperPrint = (net.sf.jasperreports.engine.JasperPrint)net.sf.jasperreports.engine.util.JRLoader.loadObject(reportFile);  net.sf.jasperreports.engine.export.JRPdfExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();  exporter.setParameter(net.sf.jasperreports.engine.JRExporterParameter.JASPER_PRINT, jasperPrint);  exporter.setParameter(net.sf.jasperreports.engine.JRExporterParameter.OUTPUT_STREAM, baos);  exporter.exportReport();[/code]
Thanks in advance.
Link to comment
Share on other sites

  • 2 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic


For Excel or HTML output should not be paginated.

parameters.put(JRParameter.IS_IGNORE_PAGINATION, true); - This is optional.It is not mandatory to pass this parameter for excel or html output

But for pdf,the output should be paginated .So we should put code as 

parameters.put(JRParameter.IS_IGNORE_PAGINATION, false); 

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...