private JRXlsxExporter xlsx(JasperIXlsxExporter jasperExporter) { SimpleOutputStreamExporterOutput exporterOutput = simpleOutputStreamExporterOutput(jasperExporter); SimpleXlsxReportConfiguration reportExportConfiguration = new SimpleXlsxReportConfiguration(); reportExcelExportConfiguration(reportExportConfiguration, jasperExporter); SimpleXlsxExporterConfiguration exporterConfiguration = new SimpleXlsxExporterConfiguration(); reportExcelExporterConfiguration(exporterConfiguration, jasperExporter); if (jasperExporter.getMacroTemplate() != null) { exporterConfiguration.setMacroTemplate(jasperExporter.getMacroTemplate()); } JRXlsxExporter jrExporter = new JRXlsxExporter(); jrExporter.setExporterOutput(exporterOutput); jrExporter.setConfiguration(reportExportConfiguration); jrExporter.setConfiguration(exporterConfiguration); return jrExporter; }
exporter = new JRXlsxExporter(); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream)); exporter.setConfiguration(new SimpleXlsxExporterConfiguration()); } else throw new ReportFormattingException("Cannot create jasper exporter using defined output type: " + outputType);
exporter = new JRXlsxExporter(); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream)); exporter.setConfiguration(new SimpleXlsxExporterConfiguration()); } else throw new ReportFormattingException("Cannot create jasper exporter using defined output type: " + outputType);