Home » Archived » BIRT » BIRT with RCP
BIRT with RCP [message #522273] |
Sun, 21 March 2010 16:14  |
Eclipse User |
|
|
|
Hi,
i want to load a report with a click on a button and create a PDF report
in a RCP-application. My code works fine on a single command line, but
in RCP i get the error below. There's just one difference:
in RCP I use
IReportEngine engine = factory.createReportEngine( config );
in my command line app I use
EngineConfig config = new EngineConfig( );
config.setEngineHome("ReportEngine");
ReportEngine engine = new ReportEngine( config );
Also I dont' know if it could be related to
task.getAppContext().put("OdaJDBCDriverClassPath", "./lib");
which I don't use in RCP.
I always get an error:
22.03.2010 01:42:15 org.eclipse.birt.report.engine.api.impl.EngineTask
setupRenderOption
SCHWERWIEGEND: Error.OutputFormatNotSupported
org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
output format pdf is not supported.
Here is my RCP code:
EngineConfig config = new EngineConfig();
// Create the report engine
IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
PDFRenderOption options = new PDFRenderOption();
HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
options.setImageHandler( imageHandler );
config.setEmitterConfiguration(PDFRenderOption.OUTPUT_FORMAT _PDF, options);
IReportRunnable report = null;
try
{
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("PMT");
URL url = FileLocator.find(bundle, new Path("/reports
/Minutes.rptdesign"), null);
String rpt = FileLocator.toFileURL(url).getPath();
report = engine.openReportDesign( rpt );
catch (Exception e)
{
System.err.println("Other Exception: " + e.getStackTrace());
e.printStackTrace();
}
if ( format != null )
{
IRunAndRenderTask task = engine.createRunAndRenderTask(report);
options.setOutputFormat( format );
String output = name;
options.setOutputFileName( output );
task.setRenderOption( options );
task.setParameterValues( params );
// Run the report.
try
{
task.run();
task.close();
Platform.shutdown();
}
catch ( Exception e1 )
{
// HERE THE ERROR IS THROWN
System.err.println( e1.toString( ) );
}
}
engine.destroy( );
By the way: I saw BIRT integrated in the RCP-app (loading report and
browser in RCP), but a lot of deprecated methods were used. Is there
anything new for the latest BIRT?
|
|
| |
Re: BIRT with RCP [message #522425 is a reply to message #522382] |
Mon, 22 March 2010 11:29   |
Eclipse User |
|
|
|
I tried the rcpengine example
( ftp://ftp.uni-frankfurt.de/pub/Mirrors2/eclipse.org/birt/dow nloads/examples/integrating/rcp/rcpengine.zip).
Under Dependencies there are:
org.eclipse.ui
org.eclipse.core.runtime
org.eclipse.birt.core (2.5.2)
org.eclipse.birt.report.engine (2.5.2)
org.eclipse.birt.report.model (2.5.2)
Same error:
22.03.2010 16:26:55 org.eclipse.birt.report.engine.api.impl.EngineTask
setupRenderOption
SCHWERWIEGEND: Error.OutputFormatNotSupported
org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
output format html is not supported.
at
org.eclipse.birt.report.engine.api.impl.EngineTask.setupRend erOption(EngineTask.java:1778)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at pmt.views.BirtView.previewReport(BirtView.java:243)
at pmt.views.BirtView.access$1(BirtView.java:205)
at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at pmt.Application.start(Application.java:25)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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:368)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Am 22.03.10 15:05, schrieb Jason Weathersby:
> Klaus,
>
> I have an example of using the engine in RCP located here:
> http://www.birt-exchange.org/devshare/deploying-birt-reports /1145-birt-2-5-integration-webinar/#description
>
>
> Look at rcpengine example. Remember that you need to set birt home to
> "" when using BIRT in RCP and make sure the BIRT runtime plugins are
> part of your RCP app.
>
> Jason
>
> Klaus Meisl wrote:
>> Hi,
>> i want to load a report with a click on a button and create a PDF report
>> in a RCP-application. My code works fine on a single command line, but
>> in RCP i get the error below. There's just one difference:
>> in RCP I use
>> IReportEngine engine = factory.createReportEngine( config );
>> in my command line app I use
>> EngineConfig config = new EngineConfig( );
>> config.setEngineHome("ReportEngine");
>> ReportEngine engine = new ReportEngine( config );
>>
>> Also I dont' know if it could be related to
>> task.getAppContext().put("OdaJDBCDriverClassPath", "./lib");
>> which I don't use in RCP.
>>
>>
>> I always get an error:
>>
>> 22.03.2010 01:42:15 org.eclipse.birt.report.engine.api.impl.EngineTask
>> setupRenderOption
>> SCHWERWIEGEND: Error.OutputFormatNotSupported
>>
>> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
>> output format pdf is not supported.
>>
>>
>>
>> Here is my RCP code:
>>
>>
>> EngineConfig config = new EngineConfig();
>> // Create the report engine
>> IReportEngineFactory factory = (IReportEngineFactory)
>> Platform.createFactoryObject(
>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>
>> IReportEngine engine = factory.createReportEngine( config );
>>
>> PDFRenderOption options = new PDFRenderOption();
>>
>> HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
>> options.setImageHandler( imageHandler );
>> config.setEmitterConfiguration(PDFRenderOption.OUTPUT_FORMAT _PDF,
>> options);
>>
>> IReportRunnable report = null;
>> try
>> {
>> Bundle bundle =
>> org.eclipse.core.runtime.Platform.getBundle("PMT");
>> URL url = FileLocator.find(bundle, new Path("/reports
>> /Minutes.rptdesign"), null);
>> String rpt = FileLocator.toFileURL(url).getPath();
>> report = engine.openReportDesign( rpt );
>> catch (Exception e)
>> {
>> System.err.println("Other Exception: " + e.getStackTrace());
>> e.printStackTrace();
>> }
>>
>> if ( format != null )
>> {
>>
>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>> options.setOutputFormat( format );
>> String output = name;
>> options.setOutputFileName( output );
>> task.setRenderOption( options );
>> task.setParameterValues( params );
>>
>>
>> // Run the report.
>> try
>> {
>> task.run();
>> task.close();
>> Platform.shutdown();
>> }
>> catch ( Exception e1 )
>> {
>> // HERE THE ERROR IS THROWN
>> System.err.println( e1.toString( ) );
>> }
>> }
>> engine.destroy( );
>>
>>
>>
>> By the way: I saw BIRT integrated in the RCP-app (loading report and
>> browser in RCP), but a lot of deprecated methods were used. Is there
>> anything new for the latest BIRT?
|
|
|
Re: BIRT with RCP [message #522719 is a reply to message #522425] |
Tue, 23 March 2010 13:41   |
Eclipse User |
|
|
|
came across this thread:
http://dev.eclipse.org/newslists/news.eclipse.birt/msg16102. html
i included org.eclipse.birt.report.engine.emitter.html,
org.eclipse.birt.report.engine.emitter.pdf, and com.lowagie.itext but
now i get other errors:
23.03.2010 18:38:48
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask doRun
SCHWERWIEGEND: An error happened while running the report. Cause:
java.lang.NullPointerException
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:123)
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:168)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at pmt.views.BirtView.previewReport(BirtView.java:255)
at pmt.views.BirtView.access$1(BirtView.java:205)
at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at pmt.Application.start(Application.java:25)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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:368)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
org.eclipse.birt.report.engine.api.EngineException: Error happened while
running the report
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:186)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at pmt.views.BirtView.previewReport(BirtView.java:255)
at pmt.views.BirtView.access$1(BirtView.java:205)
at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at pmt.Application.start(Application.java:25)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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:368)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: java.lang.NullPointerException
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:123)
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:168)
... 34 more
Am 22.03.10 16:29, schrieb Klaus Meisl:
> I tried the rcpengine example
> ( ftp://ftp.uni-frankfurt.de/pub/Mirrors2/eclipse.org/birt/dow nloads/examples/integrating/rcp/rcpengine.zip).
> Under Dependencies there are:
> org.eclipse.ui
> org.eclipse.core.runtime
> org.eclipse.birt.core (2.5.2)
> org.eclipse.birt.report.engine (2.5.2)
> org.eclipse.birt.report.model (2.5.2)
>
> Same error:
> 22.03.2010 16:26:55 org.eclipse.birt.report.engine.api.impl.EngineTask
> setupRenderOption
> SCHWERWIEGEND: Error.OutputFormatNotSupported
> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
> output format html is not supported.
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.setupRend erOption(EngineTask.java:1778)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
> at pmt.views.BirtView.previewReport(BirtView.java:243)
> at pmt.views.BirtView.access$1(BirtView.java:205)
> at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at pmt.Application.start(Application.java:25)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> 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:368)
> 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: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>
>
>
> Am 22.03.10 15:05, schrieb Jason Weathersby:
>> Klaus,
>>
>> I have an example of using the engine in RCP located here:
>> http://www.birt-exchange.org/devshare/deploying-birt-reports /1145-birt-2-5-integration-webinar/#description
>>
>>
>> Look at rcpengine example. Remember that you need to set birt home to
>> "" when using BIRT in RCP and make sure the BIRT runtime plugins are
>> part of your RCP app.
>>
>> Jason
>>
>> Klaus Meisl wrote:
>>> Hi,
>>> i want to load a report with a click on a button and create a PDF report
>>> in a RCP-application. My code works fine on a single command line, but
>>> in RCP i get the error below. There's just one difference:
>>> in RCP I use
>>> IReportEngine engine = factory.createReportEngine( config );
>>> in my command line app I use
>>> EngineConfig config = new EngineConfig( );
>>> config.setEngineHome("ReportEngine");
>>> ReportEngine engine = new ReportEngine( config );
>>>
>>> Also I dont' know if it could be related to
>>> task.getAppContext().put("OdaJDBCDriverClassPath", "./lib");
>>> which I don't use in RCP.
>>>
>>>
>>> I always get an error:
>>>
>>> 22.03.2010 01:42:15 org.eclipse.birt.report.engine.api.impl.EngineTask
>>> setupRenderOption
>>> SCHWERWIEGEND: Error.OutputFormatNotSupported
>>>
>>> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
>>> output format pdf is not supported.
>>>
>>>
>>>
>>> Here is my RCP code:
>>>
>>>
>>> EngineConfig config = new EngineConfig();
>>> // Create the report engine
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>> Platform.createFactoryObject(
>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>>
>>> IReportEngine engine = factory.createReportEngine( config );
>>>
>>> PDFRenderOption options = new PDFRenderOption();
>>>
>>> HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
>>> options.setImageHandler( imageHandler );
>>> config.setEmitterConfiguration(PDFRenderOption.OUTPUT_FORMAT _PDF,
>>> options);
>>>
>>> IReportRunnable report = null;
>>> try
>>> {
>>> Bundle bundle =
>>> org.eclipse.core.runtime.Platform.getBundle("PMT");
>>> URL url = FileLocator.find(bundle, new Path("/reports
>>> /Minutes.rptdesign"), null);
>>> String rpt = FileLocator.toFileURL(url).getPath();
>>> report = engine.openReportDesign( rpt );
>>> catch (Exception e)
>>> {
>>> System.err.println("Other Exception: " + e.getStackTrace());
>>> e.printStackTrace();
>>> }
>>>
>>> if ( format != null )
>>> {
>>>
>>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>>> options.setOutputFormat( format );
>>> String output = name;
>>> options.setOutputFileName( output );
>>> task.setRenderOption( options );
>>> task.setParameterValues( params );
>>>
>>>
>>> // Run the report.
>>> try
>>> {
>>> task.run();
>>> task.close();
>>> Platform.shutdown();
>>> }
>>> catch ( Exception e1 )
>>> {
>>> // HERE THE ERROR IS THROWN
>>> System.err.println( e1.toString( ) );
>>> }
>>> }
>>> engine.destroy( );
>>>
>>>
>>>
>>> By the way: I saw BIRT integrated in the RCP-app (loading report and
>>> browser in RCP), but a lot of deprecated methods were used. Is there
>>> anything new for the latest BIRT?
>
|
|
|
Re: BIRT with RCP [message #522953 is a reply to message #522425] |
Wed, 24 March 2010 11:42   |
Eclipse User |
|
|
|
Klaus,
Although those are the only required plugins, these plugins call others
in the runtime depending on what features of BIRT you are using. There
is a configuration file in that workspace that shows the runtime
plugins. You can also start with the BIRT runtime and take out the
plugins you do not need.
Jason
Klaus Meisl wrote:
> I tried the rcpengine example
> ( ftp://ftp.uni-frankfurt.de/pub/Mirrors2/eclipse.org/birt/dow nloads/examples/integrating/rcp/rcpengine.zip).
> Under Dependencies there are:
> org.eclipse.ui
> org.eclipse.core.runtime
> org.eclipse.birt.core (2.5.2)
> org.eclipse.birt.report.engine (2.5.2)
> org.eclipse.birt.report.model (2.5.2)
>
> Same error:
> 22.03.2010 16:26:55 org.eclipse.birt.report.engine.api.impl.EngineTask
> setupRenderOption
> SCHWERWIEGEND: Error.OutputFormatNotSupported
> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
> output format html is not supported.
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.setupRend erOption(EngineTask.java:1778)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
> at pmt.views.BirtView.previewReport(BirtView.java:243)
> at pmt.views.BirtView.access$1(BirtView.java:205)
> at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at pmt.Application.start(Application.java:25)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> 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:368)
> 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: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>
>
>
> Am 22.03.10 15:05, schrieb Jason Weathersby:
>> Klaus,
>>
>> I have an example of using the engine in RCP located here:
>> http://www.birt-exchange.org/devshare/deploying-birt-reports /1145-birt-2-5-integration-webinar/#description
>>
>>
>> Look at rcpengine example. Remember that you need to set birt home to
>> "" when using BIRT in RCP and make sure the BIRT runtime plugins are
>> part of your RCP app.
>>
>> Jason
>>
>> Klaus Meisl wrote:
>>> Hi,
>>> i want to load a report with a click on a button and create a PDF report
>>> in a RCP-application. My code works fine on a single command line, but
>>> in RCP i get the error below. There's just one difference:
>>> in RCP I use
>>> IReportEngine engine = factory.createReportEngine( config );
>>> in my command line app I use
>>> EngineConfig config = new EngineConfig( );
>>> config.setEngineHome("ReportEngine");
>>> ReportEngine engine = new ReportEngine( config );
>>>
>>> Also I dont' know if it could be related to
>>> task.getAppContext().put("OdaJDBCDriverClassPath", "./lib");
>>> which I don't use in RCP.
>>>
>>>
>>> I always get an error:
>>>
>>> 22.03.2010 01:42:15 org.eclipse.birt.report.engine.api.impl.EngineTask
>>> setupRenderOption
>>> SCHWERWIEGEND: Error.OutputFormatNotSupported
>>>
>>> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
>>> output format pdf is not supported.
>>>
>>>
>>>
>>> Here is my RCP code:
>>>
>>>
>>> EngineConfig config = new EngineConfig();
>>> // Create the report engine
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>> Platform.createFactoryObject(
>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>>
>>> IReportEngine engine = factory.createReportEngine( config );
>>>
>>> PDFRenderOption options = new PDFRenderOption();
>>>
>>> HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
>>> options.setImageHandler( imageHandler );
>>> config.setEmitterConfiguration(PDFRenderOption.OUTPUT_FORMAT _PDF,
>>> options);
>>>
>>> IReportRunnable report = null;
>>> try
>>> {
>>> Bundle bundle =
>>> org.eclipse.core.runtime.Platform.getBundle("PMT");
>>> URL url = FileLocator.find(bundle, new Path("/reports
>>> /Minutes.rptdesign"), null);
>>> String rpt = FileLocator.toFileURL(url).getPath();
>>> report = engine.openReportDesign( rpt );
>>> catch (Exception e)
>>> {
>>> System.err.println("Other Exception: " + e.getStackTrace());
>>> e.printStackTrace();
>>> }
>>>
>>> if ( format != null )
>>> {
>>>
>>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>>> options.setOutputFormat( format );
>>> String output = name;
>>> options.setOutputFileName( output );
>>> task.setRenderOption( options );
>>> task.setParameterValues( params );
>>>
>>>
>>> // Run the report.
>>> try
>>> {
>>> task.run();
>>> task.close();
>>> Platform.shutdown();
>>> }
>>> catch ( Exception e1 )
>>> {
>>> // HERE THE ERROR IS THROWN
>>> System.err.println( e1.toString( ) );
>>> }
>>> }
>>> engine.destroy( );
>>>
>>>
>>>
>>> By the way: I saw BIRT integrated in the RCP-app (loading report and
>>> browser in RCP), but a lot of deprecated methods were used. Is there
>>> anything new for the latest BIRT?
>
|
|
|
Re: BIRT with RCP [message #523259 is a reply to message #522953] |
Thu, 25 March 2010 12:56  |
Eclipse User |
|
|
|
solved it. org.eclipse.birt.report.data.oda.jdbc and
org.eclipse.birt.report.engine.script.javascript were missing
Am 24.03.10 16:42, schrieb Jason Weathersby:
> Klaus,
>
> Although those are the only required plugins, these plugins call others
> in the runtime depending on what features of BIRT you are using. There
> is a configuration file in that workspace that shows the runtime
> plugins. You can also start with the BIRT runtime and take out the
> plugins you do not need.
>
>
> Jason
>
> Klaus Meisl wrote:
>> I tried the rcpengine example
>> ( ftp://ftp.uni-frankfurt.de/pub/Mirrors2/eclipse.org/birt/dow nloads/examples/integrating/rcp/rcpengine.zip).
>>
>> Under Dependencies there are:
>> org.eclipse.ui
>> org.eclipse.core.runtime
>> org.eclipse.birt.core (2.5.2)
>> org.eclipse.birt.report.engine (2.5.2)
>> org.eclipse.birt.report.model (2.5.2)
>>
>> Same error:
>> 22.03.2010 16:26:55 org.eclipse.birt.report.engine.api.impl.EngineTask
>> setupRenderOption
>> SCHWERWIEGEND: Error.OutputFormatNotSupported
>> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
>> output format html is not supported.
>> at
>> org.eclipse.birt.report.engine.api.impl.EngineTask.setupRend erOption(EngineTask.java:1778)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:94)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
>>
>> at pmt.views.BirtView.previewReport(BirtView.java:243)
>> at pmt.views.BirtView.access$1(BirtView.java:205)
>> at pmt.views.BirtView$3.widgetSelected(BirtView.java:179)
>> at
>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
>> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1 079)
>> at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3441)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3100)
>> at
>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>
>> at
>> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at pmt.Application.start(Application.java:25)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>>
>> 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:368)
>>
>> 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: 559)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>
>>
>>
>> Am 22.03.10 15:05, schrieb Jason Weathersby:
>>> Klaus,
>>>
>>> I have an example of using the engine in RCP located here:
>>> http://www.birt-exchange.org/devshare/deploying-birt-reports /1145-birt-2-5-integration-webinar/#description
>>>
>>>
>>>
>>> Look at rcpengine example. Remember that you need to set birt home to
>>> "" when using BIRT in RCP and make sure the BIRT runtime plugins are
>>> part of your RCP app.
>>>
>>> Jason
>>>
>>> Klaus Meisl wrote:
>>>> Hi,
>>>> i want to load a report with a click on a button and create a PDF
>>>> report
>>>> in a RCP-application. My code works fine on a single command line, but
>>>> in RCP i get the error below. There's just one difference:
>>>> in RCP I use
>>>> IReportEngine engine = factory.createReportEngine( config );
>>>> in my command line app I use
>>>> EngineConfig config = new EngineConfig( );
>>>> config.setEngineHome("ReportEngine");
>>>> ReportEngine engine = new ReportEngine( config );
>>>>
>>>> Also I dont' know if it could be related to
>>>> task.getAppContext().put("OdaJDBCDriverClassPath", "./lib");
>>>> which I don't use in RCP.
>>>>
>>>>
>>>> I always get an error:
>>>>
>>>> 22.03.2010 01:42:15 org.eclipse.birt.report.engine.api.impl.EngineTask
>>>> setupRenderOption
>>>> SCHWERWIEGEND: Error.OutputFormatNotSupported
>>>>
>>>> org.eclipse.birt.report.engine.api.UnsupportedFormatExceptio n: The
>>>> output format pdf is not supported.
>>>>
>>>>
>>>>
>>>> Here is my RCP code:
>>>>
>>>>
>>>> EngineConfig config = new EngineConfig();
>>>> // Create the report engine
>>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>> Platform.createFactoryObject(
>>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>>> IReportEngine engine = factory.createReportEngine( config );
>>>>
>>>> PDFRenderOption options = new PDFRenderOption();
>>>>
>>>> HTMLCompleteImageHandler imageHandler = new
>>>> HTMLCompleteImageHandler( );
>>>> options.setImageHandler( imageHandler );
>>>> config.setEmitterConfiguration(PDFRenderOption.OUTPUT_FORMAT _PDF,
>>>> options);
>>>>
>>>> IReportRunnable report = null;
>>>> try
>>>> {
>>>> Bundle bundle =
>>>> org.eclipse.core.runtime.Platform.getBundle("PMT");
>>>> URL url = FileLocator.find(bundle, new Path("/reports
>>>> /Minutes.rptdesign"), null);
>>>> String rpt = FileLocator.toFileURL(url).getPath();
>>>> report = engine.openReportDesign( rpt );
>>>> catch (Exception e)
>>>> {
>>>> System.err.println("Other Exception: " + e.getStackTrace());
>>>> e.printStackTrace();
>>>> }
>>>>
>>>> if ( format != null )
>>>> {
>>>>
>>>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>>>> options.setOutputFormat( format );
>>>> String output = name;
>>>> options.setOutputFileName( output );
>>>> task.setRenderOption( options );
>>>> task.setParameterValues( params );
>>>>
>>>>
>>>> // Run the report.
>>>> try
>>>> {
>>>> task.run();
>>>> task.close();
>>>> Platform.shutdown();
>>>> }
>>>> catch ( Exception e1 )
>>>> {
>>>> // HERE THE ERROR IS THROWN
>>>> System.err.println( e1.toString( ) );
>>>> }
>>>> }
>>>> engine.destroy( );
>>>>
>>>>
>>>>
>>>> By the way: I saw BIRT integrated in the RCP-app (loading report and
>>>> browser in RCP), but a lot of deprecated methods were used. Is there
>>>> anything new for the latest BIRT?
>>
|
|
|
Goto Forum:
Current Time: Tue Jul 08 11:49:40 EDT 2025
Powered by FUDForum. Page generated in 0.08303 seconds
|