站内搜索

返回   安讯中国 > 安讯产品 > 应用实例及方案展示
注册
忘记密码?
论坛帮助 日历事件 搜索 今日新帖 标记版面已读

回复
 
LinkBack 主题工具 搜索本主题 显示模式
  #1 (permalink)  
旧 2008-11-26, 10:48 AM
Junior Member
 
注册日期: 2008-11-20
帖子: 1
存款: 230
默认 求异常org.eclipse.birt.report.engine.api.UnsupportedFormatException解决办法

我在www.eclipse.org上下载了一个例了,运行时出现如下错误:

2008-11-26 10:38:17 org.eclipse.birt.report.engine.api.impl.EngineTask setupRenderOption
严重: Error.OutputFormatNotSupported
org.eclipse.birt.report.engine.api.UnsupportedFormatException: The output format html is not supported.
at org.eclipse.birt.report.engine.api.impl.EngineTask.setupRenderOption(EngineTask.java:1512)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:86)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72)
at org.eclipse.birt.examples.rcpengine.View.previewReport(View.java:237)
at org.eclipse.birt.examples.rcpengine.View.access$1(View.java:205)
at org.eclipse.birt.examples.rcpengine.View$3.widgetSelected(View.java:179)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.birt.examples.rcpengine.Application.run(Application.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:195)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


主要代码如下:
EngineConfig config = new EngineConfig();
// Create the report engine
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
IReportRunnable design = null;
try {
// Open a report design - use design to modify design, retrieve
// embedded images etc.
String report = reportLocation.getText();
FileInputStream fs = new FileInputStream(report);
design = engine.openReportDesign(fs);
IRunAndRenderTask task = engine.createRunAndRenderTask(design);

// Set Render context to handle url and image locataions
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("c:/test");
HashMap<String, HTMLRenderContext> contextMap = new HashMap<String, HTMLRenderContext>();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext );
task.setAppContext(contextMap);

// Set rendering options - such as file or stream output,
// output format, whether it is embeddable, etc
IRenderOption options;
options = new HTMLRenderOption( );
ByteArrayOutputStream bos = new ByteArrayOutputStream();
options.setOutputStream(bos);
options.setOutputFormat("html");

task.setRenderOption(options);
// run the report and destroy the engine
task.run();
task.close();
//set Browser text accordingly
browser.setText(bos.toString());
engine.destroy();
} catch (Exception e) {
e.printStackTrace();
}


请问一下这是什么原因?
回复时引用此帖
  #2 (permalink)  
旧 2008-12-1, 01:29 PM
Junior Member
 
注册日期: 2008-6-19
帖子: 17
存款: 188
默认

请列出具体的例子,方便查看,谢谢!
__________________
生活就是一面镜子,你对它微笑,它也对你微笑!
回复时引用此帖
回复


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

高级搜索
显示模式

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

论坛启用 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