use of net.sf.jasperreports.export.SimpleXlsxReportConfiguration in project tutorials by eugenp.
the class SimpleReportExporter method exportToXlsx.
public void exportToXlsx(String fileName, String sheetName) {
JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(fileName));
SimpleXlsxReportConfiguration reportConfig = new SimpleXlsxReportConfiguration();
reportConfig.setSheetNames(new String[] { sheetName });
exporter.setConfiguration(reportConfig);
try {
exporter.exportReport();
} catch (JRException ex) {
Logger.getLogger(SimpleReportFiller.class.getName()).log(Level.SEVERE, null, ex);
}
}
Aggregations