我使用的是 Birt 4.4,我的 html 报告工作正常,但 xls 和 pdf 文件抛出 The output format is not supported 错误
org.eclipse.birt.report.engine.api.EngineException: The output format xsl is not supported.
at org.eclipse.birt.report.engine.api.impl.EngineTask.setupRenderOption(EngineTask.java:2031)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:96)
我尝试将输出格式设置为 xls_spudsoft
和 emitterID
但没有成功
这是代码
EXCELRenderOption xlsOptions = new EXCELRenderOption(options);
xlsOptions.setEmitterID("uk.co.spudsoft.birt.emitters.excel.XlsEmitter");
xlsOptions.setOutputFormat("xls_spudsoft");
response.setHeader("Content-Disposition", "attachment; filename=\"" + reportName + "\"");
xlsOptions.setOutputStream(response.getOutputStream());
有什么想法吗?
谢谢
最佳答案
找到问题所在,以防有人想知道如何解决这个问题。为 pdf 报告 pdfOptions.setEmitterID(RenderOption.OUTPUT_EMITTERID_PDF)
指定发射器,对于 xls,类路径中缺少 uk.co.spudsoft.birt.emitters.excel
关于java - Birt 不生成 PDF 和 XLS 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25103565/