Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Running JasperViewer inside an Eclipse RCP plugin crashes client
Running JasperViewer inside an Eclipse RCP plugin crashes client [message #460826] Fri, 29 December 2006 18:00 Go to next message
Eclipse UserFriend
Originally posted by: rdjohnson.kingwoodcable.com

From an Eclipse client I run a jasper report on a server via RMI, then bring the resulting 'jasperPrint' back to the client, for display using Jasper's 'JasperViewer' utility. The report displays in a separate window just fine, but when I close the Jasper window, the whole RCP client goes down. I tried running the viewer inside a separate thread (see below), but it still crashes. Does anyone have experience with this approach?

Code sample

// Prime command to generate report on server
startCommandAction = new StartCommandAction();
startCommandAction.setEditor(getEditor());
startCommandAction.setServiceClass("ReportRunner");
startCommandAction.setServiceMethod("executeReport");
startCommandAction.setParameters(parameters);
startCommandAction.run();
Map returnParms = startCommandAction.getReturnParms();
jasperPrint = (JasperPrint)returnParms.get("jasperPrint");
if (jasperPrint != null) {
Thread t = new Thread(new Runnable() {
public void run() {
JasperViewer.viewReport(jasperPrint); }
});
t.start();
}
Re: Running JasperViewer inside an Eclipse RCP plugin crashes client [message #460830 is a reply to message #460826] Fri, 29 December 2006 19:46 Go to previous messageGo to next message
Eclipse UserFriend
Randy,

What's the exception and error stack? This could possibly be thread issue if
you're trying to wotk with SWT through non-UI thread. See
Display.(a)syncExec(...).

thanks,
Dima

"Randy Johnson" <rdjohnson@kingwoodcable.com> wrote in message
news:22168908.1167433260546.JavaMail.root@cp1.javalobby.org...
> From an Eclipse client I run a jasper report on a server via RMI, then
> bring the resulting 'jasperPrint' back to the client, for display using
> Jasper's 'JasperViewer' utility. The report displays in a separate window
> just fine, but when I close the Jasper window, the whole RCP client goes
> down. I tried running the viewer inside a separate thread (see below), but
> it still crashes. Does anyone have experience with this approach?
>
> Code sample
>
> // Prime command to generate report on server
> startCommandAction = new StartCommandAction();
> startCommandAction.setEditor(getEditor());
> startCommandAction.setServiceClass("ReportRunner");
> startCommandAction.setServiceMethod("executeReport");
> startCommandAction.setParameters(parameters);
> startCommandAction.run();
> Map returnParms = startCommandAction.getReturnParms();
> jasperPrint = (JasperPrint)returnParms.get("jasperPrint");
> if (jasperPrint != null) {
> Thread t = new Thread(new Runnable() {
> public void run() {
> JasperViewer.viewReport(jasperPrint); }
> });
> t.start();
> }
Re: Running JasperViewer inside an Eclipse RCP plugin crashes client [message #460841 is a reply to message #460826] Sat, 30 December 2006 06:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I think you need to configure the viewer to not shutdown when the window
is closed did you try:

JasperViewer.viewReport(jasperPrint,false);

Tom

Randy Johnson schrieb:
> From an Eclipse client I run a jasper report on a server via RMI, then bring the resulting 'jasperPrint' back to the client, for display using Jasper's 'JasperViewer' utility. The report displays in a separate window just fine, but when I close the Jasper window, the whole RCP client goes down. I tried running the viewer inside a separate thread (see below), but it still crashes. Does anyone have experience with this approach?
>
> Code sample
>
> // Prime command to generate report on server
> startCommandAction = new StartCommandAction();
> startCommandAction.setEditor(getEditor());
> startCommandAction.setServiceClass("ReportRunner");
> startCommandAction.setServiceMethod("executeReport");
> startCommandAction.setParameters(parameters);
> startCommandAction.run();
> Map returnParms = startCommandAction.getReturnParms();
> jasperPrint = (JasperPrint)returnParms.get("jasperPrint");
> if (jasperPrint != null) {
> Thread t = new Thread(new Runnable() {
> public void run() {
> JasperViewer.viewReport(jasperPrint); }
> });
> t.start();
> }
Re: Running JasperViewer inside an Eclipse RCP plugin crashes client [message #460844 is a reply to message #460841] Sat, 30 December 2006 06:21 Go to previous message
Eclipse UserFriend
Hi,

By the way if you need to run this on Mac you might get into troubles.
You need a very recent version of MacOSX because of a bug with loading
of AWT-Classes in context of SWT.

Tom

Tom Schindl schrieb:
> Hi,
>
> I think you need to configure the viewer to not shutdown when the window
> is closed did you try:
>
> JasperViewer.viewReport(jasperPrint,false);
>
> Tom
>
> Randy Johnson schrieb:
>> From an Eclipse client I run a jasper report on a server via RMI, then
>> bring the resulting 'jasperPrint' back to the client, for display
>> using Jasper's 'JasperViewer' utility. The report displays in a
>> separate window just fine, but when I close the Jasper window, the
>> whole RCP client goes down. I tried running the viewer inside a
>> separate thread (see below), but it still crashes. Does anyone have
>> experience with this approach?
>>
>> Code sample
>>
>> // Prime command to generate report on server
>> startCommandAction = new StartCommandAction();
>> startCommandAction.setEditor(getEditor());
>> startCommandAction.setServiceClass("ReportRunner");
>> startCommandAction.setServiceMethod("executeReport");
>> startCommandAction.setParameters(parameters);
>> startCommandAction.run();
>> Map returnParms = startCommandAction.getReturnParms();
>> jasperPrint = (JasperPrint)returnParms.get("jasperPrint");
>> if (jasperPrint != null) {
>> Thread t = new Thread(new Runnable() {
>> public void run() {
>> JasperViewer.viewReport(jasperPrint); }
>> });
>> t.start();
>> }
Previous Topic:getting view??
Next Topic:help,problem with adding console viewer to my rcp
Goto Forum:
  


Current Time: Sat Mar 15 17:58:00 EDT 2025

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

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

Back to the top