Java Jasper中的不同输出文档、Excel和PDF?

Java Jasper中的不同输出文档、Excel和PDF?,java,excel,pdf,jasper-reports,Java,Excel,Pdf,Jasper Reports,更新 当我使用Jasper Report 5.6版本时,打印的文件(DOC、Excel和PDF)的格式不同,如下图所示。在DOC和Excel中,缺少subtotal和No.Column($V{REPORT\u COUNT})等内容 PDF(正确输出) 单据(输出不正确) EXCEL(输出不正确) 5.6代码如下所示 /*PDF File Generation */ JasperExportManager.exportReportToPdfFile(print, pdf_filePath);

更新

当我使用
Jasper Report 5.6
版本时,打印的文件(
DOC、Excel和PDF
)的格式不同,如下图所示。在
DOC
Excel
中,缺少
subtotal
No.Column($V{REPORT\u COUNT})
等内容

PDF(正确输出)

单据(输出不正确)

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

我怎样才能解决这个问题?我需要做什么配置
SimpleXlsxReportConfiguration
simpledocxpreportconfiguration

你能分享jrxml文件来重现这个问题吗。在pdf中,一切都很好,但对于doc和excel,您需要为所有元素提供正确的对齐方式。如果你发布你的jrxml文件,它会让我更好地理解代码。