Jasper中不同的输出DOC,Excel和PDF?

时间:2014-09-17 06:42:50

标签: java excel pdf jasper-reports

更新

当我使用Jasper Report 5.6版本时,打印文件(DOC, Excel and PDF)的格式与下图不同。在DOCExcel中,遗漏了subtotalNo. Column ($V{REPORT_COUNT})等内容。

PDF(正确出局)

enter image description here

DOC(错误的输出)

enter image description here

EXCEL(错误的输出)

enter image description here

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();

我该如何解决这个问题?我需要做什么配置SimpleXlsxReportConfigurationSimpleDocxReportConfiguration

0 个答案:

没有答案