Java – jasperreports is exported to xlsx instead of XLS
•
Java
I can't find how to export jasperreports 4.1 1 Xlsx file
JRXlsExporter
There is no xlsx equivalent I can't find a parameter to set the output format from XLS to xlsx
Solution
The jrxlsxexporter class applies to exporting to xlsx format
Samples used:
JRMapArrayDataSource dataSource = new JRMapArrayDataSource(data); JasperReport jasperReport = JasperCompileManager.compileReport(reportJRXMLSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,params,dataSource); JRXlsxExporter exporter = new JRXlsxExporter(); exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT,jasperPrint); exporter.setParameter(JRXlsExporterParameter.OUTPUT_FILE_NAME,outputFileName); exporter.exportReport();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码