站内搜索

返回   安讯中国 > 安讯产品 > 百灵报表(BIRT)
注册
忘记密码?
论坛帮助 日历事件 搜索 今日新帖 标记版面已读

回复
 
LinkBack 主题工具 搜索本主题 显示模式
  #1 (permalink)  
旧 2008-10-9, 09:40 AM
Junior Member
 
注册日期: 2008-10-6
帖子: 1
存款: 230
默认 求助,factory.createReportEngine(config)是出错。

用eclipse开发,在SWT画面的按钮事件中,生成html报表,第一次执行,一切正常,不关闭画面,第二次点击按钮的时候。factory.createReportEngine(config);报错。
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:13)
at com.rad.oes.form.CpBillEntry$BtnSend_selected.widgetSelected(CpBillEntry.java:2247)
恳请大师们指点指点。

代码如下,

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
IReportEngine engine = null;
IReportEngineFactory factory = null;
EngineConfig config = null;
try {
config = new EngineConfig();

config.setEngineHome("D:/birt-runtime-2_3_1/ReportEngine");
config.setLogConfig("D:/oesproject", Level.FINE);

Platform.startup(config); // If using RE API in Eclipse/RCP
// application this is not needed.
factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);

engine.changeLogLevel(Level.WARNING);

} catch (Exception ex) {
ex.printStackTrace();
}
// Run reports, etc.
HTMLRenderOption emitterConfig = new HTMLRenderOption();
emitterConfig.setActionHandler(new HTMLActionHandler());
HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
emitterConfig.setImageHandler(imageHandler);
config.getEmitterConfigs().put("html", emitterConfig);
IReportRunnable design = null;
try {
design = engine
.openReportDesign("D:/oesproject/reports/new_report.rptdesign");
} catch (EngineException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}

// 创建报表任务
IRunAndRenderTask task = engine.createRunAndRenderTask(design);

emitterConfig.setBaseURL("http://localhost/");
emitterConfig.setBaseImageURL("http://localhost/myimages");
emitterConfig.setSupportedImageFormats("JPG;PNG;BMP;SVG");
HashMap<String, HTMLRenderOption> contextMap = new HashMap<String, HTMLRenderOption>();
contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
emitterConfig);
task.setAppContext(contextMap);
// 设置输出本地文件
options.setOutputFileName("D:/oesproject/reports/output.html");

// 设置输出文件格式
options.setOutputFormat("html");
task.setRenderOption(options);

// run and render report
try {
task.run();
} catch (EngineException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
task.close();

engine.destroy();
Platform.shutdown();

}
回复时引用此帖
  #2 (permalink)  
旧 2008-10-9, 09:52 AM
Junior Member
 
注册日期: 2008-8-8
帖子: 17
存款: 185
默认

你有msn么,交流下birt
回复时引用此帖
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

论坛启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
Trackbacks are 启用
Pingbacks are 启用
Refbacks are 启用


服务条款 | 隐私政策
安讯中国 上海浦东新区浦东南路1271号华融大厦21层2101室
电话:(+86)21-58826388   发送邮件联系我们  沪ICP备06010344号
Actuate Corporation © 2008
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Content Relevant URLs by vBSEO 3.1.0