我是 BIRT 的新手,我正在尝试让报表引擎运行。我正在使用http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php中提供的代码片段
但我有一个奇怪的例外:
java.lang.AssertionError at org.eclipse.birt.core.framework.Platform.startup(Platform.java:86)
并且日志文件中没有任何内容。
也许我错过了配置中的某些内容?有人可以提示我可以尝试使其运行吗?
这是我正在使用的代码:
public static void executeReport()
{
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("D:\\birt-runtime-2_3_0\\ReportEngine");
config.setLogConfig("d:/temp", Level.FINEST);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("D:\\birt-runtime-2_3_0\\ReportEngine\\samples\\hello_world.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/Parmdisp.html");
options.setOutputFormat("html");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
finally
{
Platform.shutdown( );
}
}