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

Unable to export the chart data into CSV


njrfrens

Recommended Posts

I'm generating a bar chart using Jasper Reports. I'm showing that chart as an image in the JSP file.

There is a click button on the Jsp Page. On click of button, the data used for graph should be exported as a CSV File.

I'm using below code to export to CSV.

but it is not exporting the data. Just creating the file with zero bytes.

 

 

Code:
JasperPrint jasperPrintJRCsvExporter csvExporter = new JRCsvExporter();csvExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);csvExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"xyz.csv");csvExporter.exportReport();
Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

JasperReports exporters do not export data, but reports.  If your report consists only of a chart, the CSV export would be empty as images/charts are not exported to CSV.

If you want to see data in the CSV, you'll need to design a report that displays the data.

Regards,

Lucian

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