Question

When I input huge data to dynamic jasper in my jsp application then dynamic jasper statement exporter.exportreport() crashes tomcat server which results in termination. Is there any solution for this? Waiting for your help...

Was it helpful?

Solution

(sorry about my english)

I've been using the DJ a very long time and I had this problem some time ago. I solved the problem saving the report content to a file instead of a byte array.

My method to export pdf report is like this:

private File exportReportPDF(JasperPrint jp, File file) throws JRException,  FileNotFoundException {
    JRExporter exporter = new JRPdfExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE, file);
    exporter.exportReport();
    return file;
}

Of course, in this case you will have to pass the File and the Jasperprint to this method and work with the Returned file. Here we have reports that works with more then 500Mb

Cheers,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top