I can\'t find how to export a file in .xlsx in JasperReports 4.1.1.
The class:
JRXlsExporter
has not a Xlsx equivalent. And i can\'t
This answer is to help users with JASPER REPORT VERSION >5.6 (latest versions), hence remove the deprecated code.
In later version >5.6 the JRXlsxExporter.setParameter(..) has been deprecated.
You should use
JRMapArrayDataSource dataSource = new JRMapArrayDataSource(data);
JasperReport jasperReport = JasperCompileManager.compileReport(reportJRXMLSource);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, dataSource);
JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
File outputFile = new File("excelTest.xlsx");
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputFile));
SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
configuration.setDetectCellType(true);//Set configuration as you like it!!
configuration.setCollapseRowSpan(false);
exporter.setConfiguration(configuration);
exporter.exportReport();