Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Birt 2.6.0 Viewer in RCP Application
Birt 2.6.0 Viewer in RCP Application [message #552868] Fri, 13 August 2010 22:19 Go to next message
Mike  is currently offline Mike Friend
Messages: 4
Registered: August 2010
Junior Member
Hi,

I'm trying to move from Eclipse 3.4.2 / Birt 2.3.2 to Eclipse 3.6.0 / Birt 2.6.0. I have run into a snag when I attempt to use the viewer in my RCP application.

My install is a clean Eclipse 3.6.0 with Birt 2.6.0 install using the update site. I created a new workspace and imported all of my code. I brought the report designs into the designer and it converted them to the new version format. I did some rudimentary tests in the Report Perspective.

My app has a ReportView that extends ViewPart. This is where I run and render the report. All of my code is unchanged. Only the Eclipse and Birt plugins have. When I invoke run() method of IRunAndRenderTask, I get an EngineException. Stack trace below. I'm wondering if anyone else has seen anything like this. I found this, https://bugs.eclipse.org/bugs/show_bug.cgi?id=292109 , which seems to apply, but I can't find out what is causing the BirtException. Any ideas?

Aug 13, 2010 3:01:36 PM org.eclipse.birt.report.engine.script.internal.ScriptExecuto r addException
WARNING: null
org.eclipse.birt.report.engine.api.EngineException
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.addException(ScriptExecutor.java:158)
at org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:53)
at org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesig n(EngineTask.java:1637)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:95)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at com.zhone.rtl.tpm.rcp.views.ReportView.previewReport(ReportV iew.java:194)
at com.zhone.rtl.tpm.rcp.views.ReportView.createPartControl(Rep ortView.java:65)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2245)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1071)
at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.j ava:3822)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3819)
at com.zhone.rtl.tpm.rcp.command.handlers.ReportViewHandler.exe cute(ReportViewHandler.java:96)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(Comma ndContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(C ommandContributionItem.java:796)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.zhone.rtl.tpm.rcp.Application.start(Application.java:25)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.birt.core.exception.BirtException
at org.eclipse.birt.core.script.ScriptContext.getScriptEngine(S criptContext.java:225)
at org.eclipse.birt.core.script.ScriptContext.compile(ScriptCon text.java:145)
at org.eclipse.birt.report.engine.executor.ExecutionContext.com pile(ExecutionContext.java:736)
at org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:670)
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleScriptInternal(ScriptExecutor.java:61)
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleScript(ScriptExecutor.java:48)
at org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleInitialize(ReportScriptExecutor.java:44)
... 47 more
Aug 13, 2010 3:01:37 PM org.eclipse.birt.report.engine.script.internal.ScriptExecuto r addException
WARNING: null
org.eclipse.birt.report.engine.api.EngineException
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.addException(ScriptExecutor.java:158)
at org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleBeforeFactory(ReportScriptExecutor.java:82)
at org.eclipse.birt.report.engine.api.impl.EngineTask.startFact ory(EngineTask.java:1669)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:97)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at com.zhone.rtl.tpm.rcp.views.ReportView.previewReport(ReportV iew.java:194)
at com.zhone.rtl.tpm.rcp.views.ReportView.createPartControl(Rep ortView.java:65)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2245)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1071)
at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.j ava:3822)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3819)
at com.zhone.rtl.tpm.rcp.command.handlers.ReportViewHandler.exe cute(ReportViewHandler.java:96)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(Comma ndContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(C ommandContributionItem.java:796)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.zhone.rtl.tpm.rcp.Application.start(Application.java:25)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.birt.core.exception.BirtException
at org.eclipse.birt.core.script.ScriptContext.getScriptEngine(S criptContext.java:225)
at org.eclipse.birt.core.script.ScriptContext.compile(ScriptCon text.java:145)
at org.eclipse.birt.report.engine.executor.ExecutionContext.com pile(ExecutionContext.java:736)
at org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:670)
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleScriptInternal(ScriptExecutor.java:61)
at org.eclipse.birt.report.engine.script.internal.ScriptExecuto r.handleScript(ScriptExecutor.java:48)
at org.eclipse.birt.report.engine.script.internal.ReportScriptE xecutor.handleBeforeFactory(ReportScriptExecutor.java:74)
... 47 more
org.eclipse.birt.report.engine.api.EngineException: cant create data engine
at org.eclipse.birt.report.engine.executor.ExecutionContext.ope nDataEngine(ExecutionContext.java:848)
at org.eclipse.birt.report.engine.executor.ExecutionContext.get DataEngine(ExecutionContext.java:860)
at org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:124)
at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportExecutor.execute(WrappedReportExecutor.java:60)
at org.eclipse.birt.report.engine.internal.executor.dup.Suppres sDuplciateReportExecutor.execute(SuppressDuplciateReportExec utor.java:42)
at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportExecutor.execute(WrappedReportExecutor.java:60)
at org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportExecutor.execute(LocalizedReportExecutor.java:61)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:170)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at com.zhone.rtl.tpm.rcp.views.ReportView.previewReport(ReportV iew.java:194)
at com.zhone.rtl.tpm.rcp.views.ReportView.createPartControl(Rep ortView.java:65)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showView(Perspective.jav a:2245)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(Workbench Page.java:1071)
at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.j ava:3822)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage .java:3819)
at com.zhone.rtl.tpm.rcp.command.handlers.ReportViewHandler.exe cute(ReportViewHandler.java:96)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(Comma ndContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(C ommandContributionItem.java:796)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.zhone.rtl.tpm.rcp.Application.start(Application.java:25)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.birt.core.exception.BirtException
at org.eclipse.birt.core.script.ScriptContext.getScriptEngine(S criptContext.java:225)
at org.eclipse.birt.report.engine.adapter.ModelDteApiAdapter.<init >(ModelDteApiAdapter.java:176)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.<init >(AbstractDataEngine.java:107)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.<init >(DteDataEngine.java:85)
at org.eclipse.birt.report.engine.data.DataEngineFactory.create DataEngine(DataEngineFactory.java:100)
at org.eclipse.birt.report.engine.executor.ExecutionContext.ope nDataEngine(ExecutionContext.java:843)
... 52 more
Re: Birt 2.6.0 Viewer in RCP Application [message #552881 is a reply to message #552868] Sat, 14 August 2010 00:49 Go to previous messageGo to next message
Mike  is currently offline Mike Friend
Messages: 4
Registered: August 2010
Junior Member
I bit the bullet and grabbed the Birt source and hooked it up to my app so I could see what the actual BirtException was being gobbled by https://bugs.eclipse.org/bugs/show_bug.cgi?id=292109 .

Let me just say after a whole bunch of messing around it turns out that at some point (Birt 2.5.1??) I need to include the org.eclipse.birt.report.engine.script.javascript plugin in my configuration since I'm using scripted data sources. Its probably in the docs some place. Laughing

The report is now running and being rendered. It goes into a file for some reason, but it does work.
Re: Birt 2.6.0 Viewer in RCP Application [message #553148 is a reply to message #552881] Mon, 16 August 2010 14:38 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike,

What do you mean by it goes into a file?

Jason

On 8/13/2010 8:49 PM, Mike wrote:
> I bit the bullet and grabbed the Birt source and hooked it up to my app
> so I could see what the actual BirtException was being gobbled by
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=292109 .
> Let me just say after a whole bunch of messing around it turns out that
> at some point (Birt 2.5.1??) I need to include the
> org.eclipse.birt.report.engine.script.javascript plugin in my
> configuration since I'm using scripted data sources. Its probably in the
> docs some place. :lol:
> The report is now running and being rendered. It goes into a file for
> some reason, but it does work.
Re: Birt 2.6.0 Viewer in RCP Application [message #553285 is a reply to message #553148] Tue, 17 August 2010 00:53 Go to previous messageGo to next message
Mike  is currently offline Mike Friend
Messages: 4
Registered: August 2010
Junior Member
Jason,

I'm emitting a pdf to a temporary file created using File.createTempFile(). Once the task is finished generating the file I want to open it in a SWT Browser in a view via:

browser.setUrl( options.getOutputFileName() );

In Windows, this displays the report in a browser window in the RCP app. In Linux, the view is created, but not the browser and I get a file dialog asking where I want to save the file.

Until recently, all of development and targets have been for windows. Now I'm doing my development using Linux and also targeting Linux as a runtime environment. Its probably something stupid or a bug.

I'm also thinking that Linux might not like File and would rather have something resembles an actual URI. I'm going to look into that now.

If you have any ideas, I would appreciate it.
Re: Birt 2.6.0 Viewer in RCP Application [message #553286 is a reply to message #553285] Tue, 17 August 2010 01:01 Go to previous messageGo to next message
Mike  is currently offline Mike Friend
Messages: 4
Registered: August 2010
Junior Member
I knew I was stupid. I don't have an Acrobat reader in the Linux Firefox. All PDF files are opened in an external Document Viewer. I'm going to look into getting that installed and working.
Re: Birt 2.6.0 Viewer in RCP Application [message #553530 is a reply to message #553286] Tue, 17 August 2010 20:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Let us know how it goes.

On 8/16/2010 9:01 PM, Mike wrote:
> I knew I was stupid. I don't have an Acrobat reader in the Linux
> Firefox. All PDF files are opened in an external Document Viewer. I'm
> going to look into getting that installed and working.
Re: Birt 2.6.0 Viewer in RCP Application [message #558451 is a reply to message #552881] Sun, 12 September 2010 23:59 Go to previous message
Marco Lopes is currently offline Marco LopesFriend
Messages: 56
Registered: September 2010
Member
We had the same problem with our RCP app. Solved that one years ago.

Here is the code Smile

PDF_PRINT_JAVASCRIPT = "this.print({bUI: true, bSilent:false});\r";

String tempFile = ... create temp file...

FileOutputStream out = new FileOutputStream(tempFile);
FileInputStream in = new FileInputStream(filename);
PdfReader pdfReader = new PdfReader(in);

PdfStamper pdfStamper = new PdfStamper(pdfReader,out);
pdfStamper.addJavaScript(BirtVARS.PDF_PRINT_JAVASCRIPT);

pdfStamper.close();


We are using iText-5.0.4.jar


[Updated on: Mon, 13 September 2010 00:04]

Report message to a moderator

Previous Topic:delete
Next Topic:Yellowfin releases fact sheet on In-memory analysis
Goto Forum:
  


Current Time: Fri Dec 19 17:43:43 GMT 2014

Powered by FUDForum. Page generated in 0.01988 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software