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

Browser crash on exporting huge report in HTML


uhkudale

Recommended Posts

Hi,

I am using IE10, IE11 for exporting a huge jasper report (around 50MB of .jrprint file). Since my application is only supported on IE browser, I don't have an option of trying it out on any other browser. My Jasperreport version is 5.5.2. Here is my JSP code snippet for HTML export:

[/code]
File reportFile = new File("<<Path to the jrprint file already created on server using virtualizer>>");
String swapFilePath = "<<path to some temporary folder on server>>";
 
JRSwapFile swapFile = new JRSwapFile(swapFilePath, 4096, 100);
JRSwapFileVirtualizer virtualizer = new JRSwapFileVirtualizer(50, swapFile, true);
JasperPrint jasperPrint = (JasperPrint) net.sf.jasperreports.engine.util.JRLoader.loadJasperPrint(reportFile, virtualizer);
net.sf.jasperreports.engine.export.JRHtmlExporter exporter = new net.sf.jasperreports.engine.export.JRHtmlExporter();
 
response.resetBuffer();
 
session.setAttribute(
net.sf.jasperreports.j2ee.servlets.ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);
 
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); // JSP output writer
exporter.setParameter(JRHtmlExporterParameter.HTML_FOOTER, " ");
exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.TRUE);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../../jasperimages.123?image=");
exporter.setParameter(JRHtmlExporterParameter.IS_WRAP_BREAK_WORD, Boolean.TRUE);
exporter.setParameter(JRHtmlExporterParameter.SIZE_UNIT, JRHtmlExporterParameter.SIZE_UNIT_PIXEL);
 
exporter.exportReport();
Note that I have used virtualizer while creating .jrprint (report fill process) as well as while exporting it to html. Since the HTML output would be huge, I can't store it into some intermediate object on server otherwise it would go out ouf memory. Hence I am directly giving JSPWriter out object as OUTPUT_WRITER. 
 
When a huge report is exported (having 1000+ pages), everything works fine on server side (no OutOfMemory) but my browser crashes. I know that the response it getting written into chunks and I have enough RAM on client side, then what can I do to avoid browser crash? How can I get optimum performance for HTML export? Is there is size limit for HTML export?
 
Please give me some pointers. Thanks in advance.
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Check the timeout to make sure the web browser is not disconnecting session with the server. The problem just may be that the client does not have enough memory to hold that much data. If that's the case, there's no software fix - just have to add more memory to the client pc.

Link to comment
Share on other sites

Thanks for reply. The session is not getting disconnected. But from optimization point of view, can we introduce pagination for HTML? From jasper side, the pagination is enabled, but is there any way to bring the data in chunks from jasper to HTML?

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