Home » Eclipse Projects » BIRT » WebViewer on RAP(WebViewer on RAP)
| WebViewer on RAP [message #641634] |
Fri, 26 November 2010 06:59  |
Sudesh Bulathsinhala Messages: 173 Registered: October 2010 |
Senior Member |
|
|
hello,
I'm working on a single source business application which works with both RCP and RAP.
what would be the best approach to integrate BIRT reports in to RCP/RAP ?
our requirement is such that we would prefer to run reports within the browser widget using WebViewer.
ex.
WebViewer.display(path, WebViewer.HTML, _browser, "frameset");
where
path includes the [report_file.rptdesign]
i'm using RAP 1.4 M3 and BIRT 2.6.1
i've examined the following article, but did not find exactly what i was looking.
http://wiki.eclipse.org/RAP/BIRT_Integration
our requirement is to open .rptdesign report files within browser widget using WebViewer.
kindly let me know if any best practices material/resource/help is available for the above.
regards,
sudesh
|
|
|
| Re: WebViewer on RAP [message #641881 is a reply to message #641634] |
Sun, 28 November 2010 23:57   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
Sudesh,
Here is a tutorial with BIRT and RAP.
If you just want to use the viewer plugin with a browser widget that is
pretty simple. See examples with this presentation.
http://www.birt-exchange.org/org/devshare/deploying-birt-rep orts/1187-eclipsecon-2010-birt-metal-ppt/
Essentially if you have the birt plugins in your runtime you can add the
following dependencies to your app:
org.eclipse.birt.report.viewer
org.eclipse.birt.core
org.eclipse.help.appserver
org.eclipse.help.base
and call
HashMap myparms = new HashMap();
HashMap emitmap = new HashMap();
myparms.put("SERVLET_NAME_KEY", "frameset");
myparms.put("FORMAT_KEY", "html");
//myparms.put("RESOURCE_FOLDER_KEY", "c:/myresources");
myparms.put("ALLOW_PAGE", "false");
myparms.put("SHOW_PARAMETER_PAGE", "false");
emitmap.put("Top Count", "6");
myparms.put("EMITTER_OPTIONS_KEY", emitmap);
//myparms.put("MAX_ROWS_KEY", "500");
WebViewer.display(rpt, browser, myparms);
where browser is the swt browser widget.
Jason
On 11/26/2010 6:59 AM, Sudesh Bulathsinhala wrote:
> hello,
>
> I'm working on a single source business application which works with
> both RCP and RAP.
>
> what would be the best approach to integrate BIRT reports in to RCP/RAP ?
>
> our requirement is such that we would prefer to run reports within the
> browser widget using WebViewer.
>
> ex.
> WebViewer.display(path, WebViewer.HTML, _browser, "frameset");
> where path includes the [report_file.rptdesign]
>
> i'm using RAP 1.4 M3 and BIRT 2.6.1
>
> i've examined the following article, but did not find exactly what i was
> looking.
>
> http://wiki.eclipse.org/RAP/BIRT_Integration
>
> our requirement is to open .rptdesign report files within browser widget
> using WebViewer.
>
>
> kindly let me know if any best practices material/resource/help is
> available for the above.
>
> regards,
> sudesh
Jason Weathersby
BIRT Exchange
|
|
| | | | | | | | |
| Re: WebViewer on RAP [message #643507 is a reply to message #643410] |
Tue, 07 December 2010 02:46   |
Sudesh Bulathsinhala Messages: 173 Registered: October 2010 |
Senior Member |
|
|
hello jason,
i've marked [org.eclipse.birt.report.designer.ui] optional as you suggested, but still it doesn't work.
i'm using the following method to invoke the report :
public void decorateReportInBrowser(Browser browser, String reportFilePath,
String servletNameKey, String formatKey, boolean allowPage,
boolean showParameterPage, int topCount, int maxRows) {
HashMap reportParams = new HashMap();
HashMap emitterParams = new HashMap();
reportParams.put("SERVLET_NAME_KEY", servletNameKey);
reportParams.put("FORMAT_KEY", formatKey);
reportParams.put("MAX_ROWS_KEY", Integer.toString(maxRows));
/* myparms.put("RESOURCE_FOLDER_KEY", "c:/myresources"); */
reportParams.put("ALLOW_PAGE", Boolean.toString(allowPage));
reportParams.put("SHOW_PARAMETER_PAGE",
Boolean.toString(showParameterPage));
emitterParams.put("Top Count", Integer.toString(topCount));
reportParams.put("EMITTER_OPTIONS_KEY", emitterParams);
WebViewer.display(reportFilePath, browser, reportParams);
}
ERROR MESSAGE :
!ENTRY org.eclipse.rap.ui 4 0 2010-12-07 13:09:48.374
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/birt/report/designer/ui/ReportPlugin
at org.eclipse.birt.report.viewer.utilities.ViewerClassPathHelp er.getWorkspaceClassPath(ViewerClassPathHelper.java:191)
at org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:756)
at org.eclipse.birt.report.viewer.utilities.WebViewer.display(W ebViewer.java:1004)
at org.eclipse.birt.report.viewer.utilities.WebViewer.display(W ebViewer.java:998)
at com.argos.sys.base.controller.birt.provider.CustomBirtReport Provider.decorateReportInBrowser(CustomBirtReportProvider.ja va:42)
at com.argos.sys.base.controller.widget.editor.CustomReportEdit orPart.invokeRunReport(CustomReportEditorPart.java:381)
at com.argos.sys.base.controller.widget.editor.CustomReportEdit orPart.access$1(CustomReportEditorPart.java:367)
at com.argos.sys.base.controller.widget.editor.CustomReportEdit orPart$5.handleEvent(CustomReportEditorPart.java:319)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc hEvent(UntypedEventAdapter.java:651)
at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS elected(UntypedEventAdapter.java:88)
at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(Sel ectionEvent.java:194)
at org.eclipse.rwt.internal.events.Event.processEvent(Event.jav a:44)
at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:161)
at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.jav a:201)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.j ava:1100)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1090)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2390)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.jface.internal.databinding.realmadapter.RealmAda pter.run(RealmAdapter.java:44)
at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault( RealmAdapterHook.java:48)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:427)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
at com.argos.sys.client.entrypoint._rap.ClientEntryPoint.create UI(ClientEntryPoint.java:18)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:245)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:114)
at java.lang.Thread.run(Unknown Source)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav a:102)
Caused by: java.lang.ClassNotFoundException: org.eclipse.birt.report.designer.ui.ReportPlugin
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 31 more
Thanks,
Sudesh
[Updated on: Tue, 07 December 2010 02:47] Report message to a moderator
|
|
|
| Re: WebViewer on RAP [message #643620 is a reply to message #643507] |
Tue, 07 December 2010 11:03   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
Sudesh,
This looks like a change that was introduced for designer classpath
issues. In the WebViewer class there is a startWebApp method that adds
urls to the cp based on the designer classpath:
try
{
// if don't load debug ui, viewer will handle to set workspace
// classpath
String debugMode = System.getProperty( REPORT_DEBUT_MODE );
if ( debugMode == null )
{
// get workspace classpath
URL[] urls = ViewerClassPathHelper.getWorkspaceClassPath(
reportFileName );
if ( reloadableClassLoader == null )
{
// create ReloadableClassLoader
reloadableClassLoader = new ReloadableClassLoader( urls,
WebViewer.class.getClassLoader( ) );
}
else
{
// reload class
reloadableClassLoader.setUrls( urls );
reloadableClassLoader.reload( );
}
}
Can you try to set the debug mode to true?
System.setProperty( WebViewer.REPORT_DEBUT_MODE,true );
before calling your viewer code? Also it would be good if you could log
a bug for this.
Jason
On 12/7/2010 2:46 AM, Sudesh Bulathsinhala wrote:
> hello jason,
>
> i've marked [org.eclipse.birt.report.designer.ui] optional as you
> suggested, but still it doesn't work.
>
> i'm using the following method to invoke the report :
>
> public void decorateReportInBrowser(Browser browser, String reportFilePath,
> String servletNameKey, String formatKey, boolean allowPage,
> boolean showParameterPage, int topCount, int maxRows) {
> HashMap reportParams = new HashMap();
> HashMap emitterParams = new HashMap();
> reportParams.put("SERVLET_NAME_KEY", servletNameKey);
> reportParams.put("FORMAT_KEY", formatKey);
> reportParams.put("MAX_ROWS_KEY", Integer.toString(maxRows));
> /* myparms.put("RESOURCE_FOLDER_KEY", "c:/myresources"); */
> reportParams.put("ALLOW_PAGE", Boolean.toString(allowPage));
> reportParams.put("SHOW_PARAMETER_PAGE",
> Boolean.toString(showParameterPage));
> emitterParams.put("Top Count", Integer.toString(topCount));
> reportParams.put("EMITTER_OPTIONS_KEY", emitterParams);
> WebViewer.display(reportFilePath, browser, reportParams);
> }
>
>
> ERROR MESSAGE :
>
> !ENTRY org.eclipse.rap.ui 4 0 2010-12-07 13:09:48.374
> !MESSAGE Unhandled event loop exception
> !STACK 0
> java.lang.NoClassDefFoundError:
> org/eclipse/birt/report/designer/ui/ReportPlugin
> at org.eclipse.birt.report.viewer.utilities.ViewerClassPathHelp
> er.getWorkspaceClassPath(ViewerClassPathHelper.java:191)
> at org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA
> pp(WebViewer.java:756)
> at org.eclipse.birt.report.viewer.utilities.WebViewer.display(W
> ebViewer.java:1004)
> at org.eclipse.birt.report.viewer.utilities.WebViewer.display(W
> ebViewer.java:998)
> at com.argos.sys.base.controller.birt.provider.CustomBirtReport
> Provider.decorateReportInBrowser(CustomBirtReportProvider.ja va:42)
> at com.argos.sys.base.controller.widget.editor.CustomReportEdit
> orPart.invokeRunReport(CustomReportEditorPart.java:381)
> at com.argos.sys.base.controller.widget.editor.CustomReportEdit
> orPart.access$1(CustomReportEditorPart.java:367)
> at com.argos.sys.base.controller.widget.editor.CustomReportEdit
> orPart$5.handleEvent(CustomReportEditorPart.java:319)
> at org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc
> hEvent(UntypedEventAdapter.java:651)
> at org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS
> elected(UntypedEventAdapter.java:88)
> at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(Sel
> ectionEvent.java:194)
> at org.eclipse.rwt.internal.events.Event.processEvent(Event.jav a:44)
> at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:161)
> at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.jav a:201)
> at org.eclipse.swt.widgets.Display.runPendingMessages(Display.j ava:1100)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :1090)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2390)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
> at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:22 06)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.jface.internal.databinding.realmadapter.RealmAda
> pter.run(RealmAdapter.java:44)
> at org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(
> RealmAdapterHook.java:48)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
> bench.java:427)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:157)
> at com.argos.sys.client.entrypoint._rap.ClientEntryPoint.create
> UI(ClientEntryPoint.java:18)
> at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU
> I(EntryPointManager.java:92)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT
> LifeCycle.java:245)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont
> roller.run(RWTLifeCycle.java:114)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.jav a:102)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.birt.report.designer.ui.ReportPlugin
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:513)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:429)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:417)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 31 more
>
>
>
Jason Weathersby
BIRT Exchange
|
|
| | | | |
| Re: WebViewer on RAP [message #871996 is a reply to message #641634] |
Tue, 15 May 2012 05:11   |
Rohit rai Messages: 5 Registered: May 2012 |
Junior Member |
|
|
Hi Jason,
We are trying to implement exactly similar stuff of seeing the web viewer in rap browser but without any success.
Here is code we have used to call start and display webviewer
HashMap reportParams = new HashMap();
HashMap emitterParams = new HashMap();
reportParams.put("SERVLET_NAME_KEY", "frameset");
reportParams.put("FORMAT_KEY", "html");
reportParams.put("MAX_ROWS_KEY", "500");
reportParams.put("ALLOW_PAGE", "true");
reportParams.put("SHOW_PARAMETER_PAGE",
Boolean.toString(false));
emitterParams.put("Top Count", "6");
reportParams.put("EMITTER_OPTIONS_KEY", emitterParams);
System.setProperty( WebViewer.REPORT_DEBUT_MODE, "true");
Shell dialog = new Shell (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
dialog.setLayout(new FillLayout());
Browser browser = new Browser(dialog, SWT.NONE);
dialog.setText ("Birt Reporting");
dialog.setSize (1000, 800);
dialog.open ();
WebViewer.startup();
WebViewer.display(nameReport, browser, reportParams);
The browser just goes on processing and doesnt shows anything...are we doing something incorrect here??
Thanks
|
|
|
| Re: WebViewer on RAP [message #872273 is a reply to message #871996] |
Tue, 15 May 2012 16:10   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
What birt version are you using? If you comment out this line:
reportParams.put("SHOW_PARAMETER_PAGE",
Boolean.toString(false));
does it work?
Jason
On 5/15/2012 5:11 AM, Rohit rai wrote:
> Hi Jason,
>
> We are trying to implement exactly similar stuff of seeing the web
> viewer in rap browser but without any success.
> Here is code we have used to call start and display webviewer
> HashMap reportParams = new HashMap();
> HashMap emitterParams = new HashMap();
> reportParams.put("SERVLET_NAME_KEY", "frameset");
> reportParams.put("FORMAT_KEY", "html");
> reportParams.put("MAX_ROWS_KEY", "500");
>
> reportParams.put("ALLOW_PAGE", "true");
> reportParams.put("SHOW_PARAMETER_PAGE",
> Boolean.toString(false));
> emitterParams.put("Top Count", "6");
> reportParams.put("EMITTER_OPTIONS_KEY", emitterParams);
> System.setProperty( WebViewer.REPORT_DEBUT_MODE, "true");
>
> Shell dialog = new Shell
> (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
> dialog.setLayout(new FillLayout());
>
> Browser browser = new Browser(dialog, SWT.NONE);
>
> dialog.setText ("Birt Reporting");
> dialog.setSize (1000, 800);
> dialog.open ();
> WebViewer.startup();
> WebViewer.display(nameReport, browser, reportParams);
>
> The browser just goes on processing and doesnt shows anything...are we
> doing something incorrect here??
>
> Thanks
Jason Weathersby
BIRT Exchange
|
|
| |
| Re: WebViewer on RAP [message #873157 is a reply to message #872464] |
Thu, 17 May 2012 11:50   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
Do you have all the birt plugins available in the runtime of your app?
If you use WebViewer.display(nameReport, reportParams); instead of
WebViewer.display(nameReport, browser, reportParams); is there any
difference?
Jason
On 5/16/2012 3:19 AM, Rohit rai wrote:
> Thanks for the reply Jason!
> I tried removing reportParams.put("SHOW_PARAMETER_PAGE",
> Boolean.toString(false)) from the code but its behaving the same.
> Actually, when "WebViewer.display(nameReport, browser, reportParams);"
> code is executed, the browser goes on processing and the application
> become unavailable and needs to restarted
> I also gets following error on the console
> May 16, 2012 12:36:42 PM org.apache.axis.utils.JavaUtils
> isAttachmentSupported
> WARNING: Unable to find required classes (javax.activation.DataHandler
> and javax.mail.internet.MimeMultipart). Attachment support is disabled.
>
> I am using 3.7 version of birt
> (org.eclipse.birt.report.viewer_3.7.0.v20110602) and dependencies
>
> Let me know you views.Thanks!
Jason Weathersby
BIRT Exchange
|
|
| | | | | |
| Re: WebViewer on RAP [message #875396 is a reply to message #875204] |
Tue, 22 May 2012 13:02  |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
Rohit,
I did not realize you were using the POJO runtime. If you look at the
other downloads for 3.7.2 you can find that we also have an osgi runtime
as well. That may be the one you want to try.
http://download.eclipse.org/birt/downloads/build.php?build=R-R1-3_7_2-201202141408
Jason
On 5/22/2012 6:12 AM, Rohit rai wrote:
> Hello Jason,
> I had look into the tutorial but I want to start the birt webviewer
> (WebViewer.display(nameReport, browser ,reportParams);)in rap. In the
> tutorial they have used IRunAndRenderTask and IReportEngineFactory.
> I want to achieve exactly same stuff as achieved by Sudesh. Sudesh was
> trying to use 2.5 birt version and I am tryig to use 3.7 ..can that be
> issue??
>
> Also, I am trying to build workspace as per tutorial, I am getting
> following error:
> java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IPlatformRunnable
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632)
>
> .....................
>
> When I investigated I found that this is happening due to inclusion of
> org.eclipse.birt.runtime_3.7.2.v20120214-1408.jar. I also cannt exclude
> this. Do you have any idea regarding this??
>
> Thanks, Rohit
Jason Weathersby
BIRT Exchange
|
|
|
Goto Forum:
Current Time: Thu May 23 08:44:03 EDT 2013
Powered by FUDForum. Page generated in 0.09306 seconds
|