Bitte helfen Sie mir bei diesem Problem. Ich habe xlsxConfiguration eingerichtet, erhalte jedoch die Datei xl.meta. Was mache ich falsch? Ich möchte eine XLSX-Datei erhalten.
GeneratorConfig:
public byte[] generate(InputStream inputStream, ReportData reportData) {
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
Map params = reportData.getParams() != null ?reportData.getParams() : new HashMap();
params.put(JRParameter.REPORT_LOCALE, new Locale("ru"));
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(inputStream);
JasperPrint jasperPrint = JasperFillManager.fillReport(
jasperReport,
params,
CollectionUtils.isEmpty(reportData.getDataSources())
? new JREmptyDataSource()
: new JRBeanCollectionDataSource(reportData.getDataSources())
);
JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(os));
SimpleXlsxReportConfiguration xlsxReportConfiguration = new SimpleXlsxReportConfiguration();
xlsxReportConfiguration.setMaxRowsPerSheet(30000);
exporter.setConfiguration(xlsxReportConfiguration);
exporter.exportReport();
return os.toByteArray();
} catch (IOException | JRException e) {
log.error("Error while producing report: [{}]", e.getMessage(), e);
throw new ReportGenerationException(e);
}
}
JasperReports generiert xl.meta, benötigt xlsx ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post