Can JRXlsxExporter be used for 2007 excel (XLSX) export.

We are in the process of upgrading Jasper verion from 2.+ to latest version preferrably 5.0.0 for generating 2007 compatible excel reports. As mentioned in the blogs and suggested by community, we are using JRXlsxExporter for exporting the data into xlsx format. We are able to generate xlsx file with JRXlsxExporter but on opening it we are receiving Excel found unreadable content in xslx file for every excel report. On going through Microsoft site, it says some of the xlsx files generated by third party packages are not fully compliant with 2007 excel format but, I see few folks based on their questions and answers that they are able to generate 2007 excel files in this community. Generated xslx report which gives error is attached to this question for your review. Prior to upgrade, we are using JExcel for generating xls reports and we were fine but JExcel is not able to generate 2007 file.

iReports is able to generate the xlsx format file successfully as I don't see such error on opening the file generated by it. What is that we are missing?. Is JRXlsxExporter able to generate 2007 excel report or do we have to use some other functionality? There should be a way as iReports is able to generate it. Can you please help us.

JRXlsxExporter exporterXLSXReporter = new JRXlsxExporter();

exporterXLSXReporter.setParameter(JRXlsExporterParameter.JASPER_PRINT,jasperPrint);

exporterXLSXReporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,stream);

exporterXLSXReporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, new Boolean(false));

exporterXLSXReporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,new Boolean(true));

exporterXLSXReporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,new Boolean(true));

exporterXLSXReporter.exportReport();

 

We have tons of reports that need to be migrated from 2003 to 2007.

Attachments: 
raj.potluri's picture
Joined: Jan 7 2013 - 6:52am
Last seen: 10 years 5 months ago
Hello raj.polituri, Did You find the solution for Your problem. I had similar problem when I get an error when opening xlsx file because of date type. But with new versions of jasperreports (eg 4.8.0 5.0) this problem is solved. Now, when I export file if English localization is selected, I get date in regular format, but time is incorrect. Instead of getting time like 9:00 PM i get 21:00 a. It looks like this part prints the pattern format. Do You have any idea what happens? Thanks in advance
dilejni1987 - 10 years 3 months ago

1 Answer:

I got the same error and I want to change the jar version to 6.5, but the JFreeChartRenderer class was deprecated, this is very awkward.

 

leongfeng's picture
Joined: Oct 22 2015 - 6:54pm
Last seen: 5 years 5 months ago
Feedback