Otakon Posted August 15, 2007 Share Posted August 15, 2007 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 virtualizerJRSwapFileVirtualizer virtualizer = new JRSwapFileVirtualizer(2, new JRSwapFile("/tmp", 2048, 2048), true);properties.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);// the filling partJasperPrint jasperPrint = JasperManager.fillReport( jasperReport, properties, conn );// the exporting partJRXlsExporter 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 advancePost edited by: Otakon, at: 2007/08/15 15:38 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now