java - Birt 不生成 PDF 和 XLS 报告

标签 java spring-mvc birt

我使用的是 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_spudsoftemitterID 但没有成功

这是代码

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/

相关文章:

java - ...NoteController 中的字段存储库需要类型为 ...NoteRepository 的 bean,但无法找到

json - 让 jackson 忽略序列化为 json 时延迟初始化的字段

java - 不可能出现 NullPointerException

java - 无法在 spring mvc 中显示带有错误消息的同一页面

xml - BIRT 不显示 base64 编码的图像

java.net.MalformedURLException : no protocol: <user url>

java - Birt 中的多个总计

java - 读取制表符分隔的文本文件java

java/opengl : loading textures on 64bit VM

javafx webview 不支持 Ajax 网络功能