|
|
|||
|
|||
|
我在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(); } 请问一下这是什么原因? |
![]() |
| 主题工具 | 搜索本主题 |
| 显示模式 | |
|
|