我使用BIRT運行時引擎4.2.1 &在此之後link。無法使用spudsoft-birt-excel-emitters生成BIRT報告 - Error.InvalidEmitterID
1.我已將下列jar文件移至birt-runtime-4_2_1 \ ReportEngine \ lib文件夾。 uk.co.spudsoft.birt.emitters.excel_0.8.0.201310230652 commons-codec-1.5 dom4j-1.6.1 poi-3.9-20121203 poi-ooxml-3.9-20121203 poi-ooxml-schemas-3.9-20121203 slf4j-api-1.6.2 stax-api-1.0.1 xmlbeans-2.3.0
2.Changed代碼使用spudsoft emitter.`public類RunReport {
public static void runReport() throws Exception {
IReportEngine engine = null;
EngineConfig config = new EngineConfig();
config.setEngineHome("C:/BIRT/BIRT_2_6_1/birt-runtime-4_2_1/birt-runtime-4_2_1/ReportEngine");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
IReportRunnable design = engine.openReportDesign("C:/reports/csvReport2.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
IRenderOption options = new RenderOption();
options.setOutputFormat("xls");
options.setOutputFileName("C:/reports/native.xls");
options.setEmitterID("uk.co.spudsoft.birt.emitters.excel.XlsEmitter");
task.setRenderOption(options);
task.run();
task.close();
Platform.shutdown();
System.out.println("Report Generated Sucessfully!!");
}`
收到以下錯誤而執行報告。
Jun 05, 2017 9:32:33 AM org.eclipse.birt.report.engine.api.impl.EngineTask setupRenderOption
SEVERE: Error.InvalidEmitterID
org.eclipse.birt.report.engine.api.EngineException: EmitterID uk.co.spudsoft.birt.emitters.excel.XlsEmitter for render option is invalid.
at org.eclipse.birt.report.engine.api.impl.EngineTask.setupRenderOption(EngineTask.java:2022)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:96)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at RunReport.runReport(RunReport.java:49)
at RunReport.main(RunReport.java:58)
Picked up _JAVA_OPTIONS: -Xmx512M
有沒有我想念的步驟或配置!
注:我試圖使用spudsoft發射器與默認發射器,下面的錯誤提示打開Excel時。
File format and extension of 'orders.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?