在Jasper中输出不同的DOC,Excel和PDF?
更新
当我使用Jasper Report 5.6
版本时,打印的文件( DOC, Excel and PDF
)与下面的图像格式不同。 在DOC
和Excel
,缺lesssubtotal
和No. Column ($V{REPORT_COUNT})
。
PDF(正确的出门)
DOC(不正确的输出)
EXCEL(不正确的输出)
5.6代码如下
/*PDF File Generation */ JasperExportManager.exportReportToPdfFile(print, pdf_filePath); /*Excel File Generation */ JRXlsxExporter xlsEexporter = new JRXlsxExporter(); xlsEexporter.setExporterInput(new SimpleExporterInput(print)); xlsEexporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(xls_filePath))); SimpleXlsxReportConfiguration config = new SimpleXlsxReportConfiguration(); xlsEexporter.setConfiguration(config); xlsEexporter.exportReport(); /*Doc File Generation */ JRDocxExporter docxExporter = new JRDocxExporter(); docxExporter.setExporterInput(new SimpleExporterInput(print)); docxExporter.setExporterOutput(new SimpleOutputStreamExporterOutput(new File(doc_filePath))); SimpleDocxReportConfiguration config = new SimpleDocxReportConfiguration(); docxExporter.setConfiguration(config); docxExporter.exportReport();
我怎么解决这个问题? 我需要做什么configurationSimpleXlsxReportConfiguration
和SimpleDocxReportConfiguration
?