Jump to content
Changes to the Jaspersoft community edition download ×

Problems with large reports and virtualizer


Otakon

Recommended Posts

Hi, I'm having problems dealing with large reports. I'm using jasperreports 1.3.4. Before I started using the virtualizer, I used to get the OutOfMemoryError when filling the report (generating the JasperPrint). After that I started using JRSwapFileVirtualizer, and it passed the filling part without memory problems.

 

My problem now is when I'm trying to export the report, it seems that it's loading the entire swap file into memory in order to export it and in the process runs out of memory (I may be wrong about this one, it's just my impression).

 

I post the code that I'm using:

 

Code:

// the virtualizer
JRSwapFileVirtualizer virtualizer = new JRSwapFileVirtualizer(2, new JRSwapFile("/tmp", 2048, 2048), true);
properties.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);

// the filling part
JasperPrint jasperPrint = JasperManager.fillReport( jasperReport, properties, conn );

// the exporting part
JRXlsExporter exporter = new JRXlsExporter();
OutputStream outputStream = new FileOutputStream(new File("/tmp/test.xls"«»));
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);
exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporter.exportReport();


 

thx in advance

Post edited by: Otakon, at: 2007/08/15 15:38

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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