Running JasperViewer inside an Eclipse RCP plugin crashes client [message #460826] |
Fri, 29 December 2006 18:00  |
Eclipse User |
|
|
|
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 #460844 is a reply to message #460841] |
Sat, 30 December 2006 06:21  |
Eclipse User |
|
|
|
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();
>> }
|
|
|
Powered by
FUDForum. Page generated in 0.04027 seconds