njrfrens Posted March 18, 2009 Share Posted March 18, 2009 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 More sharing options...
njrfrens Posted April 3, 2009 Author Share Posted April 3, 2009 Hi Can any one please inform me if there is any solution for it...? At least please inform me whether this is feasible or not? Link to comment Share on other sites More sharing options...
lucianc Posted April 6, 2009 Share Posted April 6, 2009 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 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