Jump to content
Changes to the Jaspersoft community edition download ×

Not able to create CSV Report using JRCsvExporter


Recommended Posts

I am trying to create a CSV report using Jasper in Java. My resultset has 1 million records. I am using JRSwapFile.

Below is my Java code.JRSwapFile swapFile = new JRSwapFile("/mnt/reporting/", 2048, 1024);JRAbstractLRUVirtualizer virtualizer = new JRSwapFileVirtualizer(3, swapFile, false);parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);parameters.put("IS_IGNORE_PAGINATION", true); jasperReports = new JRResultSetDataSource(rset);jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jasperReports);JRCsvExporter exporterCSV = new JRCsvExporter();SimpleCsvReportConfiguration configuration = new SimpleCsvReportConfiguration();exporterCSV.setExporterInput(new SimpleExporterInput(jasperPrint));exporterCSV.setExporterOutput(new SimpleWriterExporterOutput("pathForReport");exporterCSV.exportReport();This swap file generated in 1.2GB, but the code gets stuck at exporterCSV.exportReport();This line of code never completes. Works fine for small reports.[/code]
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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