How to use BIRT 3.7.1 on NetBeans? [message #798940] |
Wed, 15 February 2012 08:50  |
Sergey Syr Messages: 19 Registered: February 2012 |
Junior Member |
|
|
Hi! Sorry to my articulation, My English is poor )) I'm from Russia, Moscow
Please, show me example code for use BIRT Run-time 3.7.1 on JAVA
I use NetBeans7.1 and GlassFish 3.1.1
I use this code, but it dont work.
public void executeReport() throws EngineException
{
IReportEngine engine=null;
EngineConfig config = null;
try{
String path = "C:\\BIRT\\birt-runtime-3_7_1\\ReportEngine";
config = new EngineConfig( );
config.setBIRTHome(path);
config.setLogConfig("c:/temp/test", Level.FINEST);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
String rpath = "C:\\BIRT\\birt-runtime-3_7_1\\ReportEngine\\new.rptdesign";
design = engine.openReportDesign(rpath);
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
//task.setParameterValue("Top Count", (new Integer(5)));
//task.validateParameters();
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("c:/temp/Parmdisp.html");
options.setOutputFormat("html");
//options.setHtmlRtLFlag(false);
//options.setEmbeddable(false);
//options.setImageDirectory("C:\\test\\images");
//PDFRenderOption options = new PDFRenderOption();
//options.setOutputFileName("c:/temp/test.pdf");
//options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
finally
{
Platform.shutdown( );
}
}
-----
ON Platform.startup( config );
OR engine = factory.createReportEngine( config );
It droping to
Platform.shutdown( );
[#|2012-02-14T14:53:53.409+0300|WARNING|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=25;_ThreadName=Thread-2;|StandardWrapperValve[srvTest]: PWC1406: Servlet.service() for servlet srvTest threw exception
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/CoreException
at org.eclipse.birt.core.framework.Platform.createPlatformLauncher(Platform.java:115)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:74)
at org.eclipse.birt.report.engine.api.ReportEngine.<init>(ReportEngine.java:59)
at com.mecheltrans.test_1.testProcessor.executeReport(testProcessor.java:49)
at com.mecheltrans.test_1.srvTest.processRequest(srvTest.java:65)
at com.mecheltrans.test_1.srvTest.doGet(srvTest.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.CoreException
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
... 33 more
|#]
What files and folders must be in "ReportEngine", besides that in standard archive birt-runtime-3_7_1.zip??
This code is correctly for 3.7.1 version birt-runtime?
Thank You!
[Updated on: Wed, 15 February 2012 08:55] Report message to a moderator
|
|
|
Re: How to use BIRT 3.7.1 on NetBeans? [message #799276 is a reply to message #798940] |
Wed, 15 February 2012 17:27   |
|
In 3.7.1 you should not set:
config.setBIRTHome(path);
Just add the jars from
C:\BIRT\birt-runtime-3_7_1\ReportEngine\lib
to your classpath and run the code you have.
Jason
On 2/15/2012 3:50 AM, Sergey Syr wrote:
> Hi! Sorry to my articulation, My English is poor )) I'm from Russia, Moscow
>
> Please, show me example code for use BIRT Run-time 3.7.1 on JAVA
> I use NetBeans7.1 and GlassFish 3.1.1
>
> I use this code, but it dont work.
>
> public void executeReport() throws EngineException
> {
> IReportEngine engine=null;
> EngineConfig config = null;
>
> try{
> String path = "C:\\BIRT\\birt-runtime-3_7_1\\ReportEngine";
> config = new EngineConfig( ); config.setBIRTHome(path);
> config.setLogConfig("c:/temp/test", Level.FINEST);
> Platform.startup( config );
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> engine = factory.createReportEngine( config );
>
> IReportRunnable design = null;
> //Open the report design
> String rpath = "C:\\BIRT\\birt-runtime-3_7_1\\ReportEngine\\new.rptdesign";
> design = engine.openReportDesign(rpath);
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
> //task.setParameterValue("Top Count", (new Integer(5)));
> //task.validateParameters();
>
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputFileName("c:/temp/Parmdisp.html");
> options.setOutputFormat("html");
> //options.setHtmlRtLFlag(false);
> //options.setEmbeddable(false);
> //options.setImageDirectory("C:\\test\\images");
>
> //PDFRenderOption options = new PDFRenderOption();
> //options.setOutputFileName("c:/temp/test.pdf");
> //options.setOutputFormat("pdf");
>
> task.setRenderOption(options);
> task.run();
> task.close();
> engine.destroy();
> }catch( Exception ex){
> ex.printStackTrace();
> }
> finally
> {
> Platform.shutdown( );
> }
> }
> -----
>
> ON Platform.startup( config );
> OR engine = factory.createReportEngine( config );
> It droping to
> Platform.shutdown( );
>
> What files and folders must be in "ReportEngine", besides that in
> standard archive birt-runtime-3_7_1.zip??
> This code is correctly for 3.7.1 version birt-runtime?
>
>
|
|
|
|
|
Re: How to use BIRT 3.7.1 on NetBeans? [message #890585 is a reply to message #890469] |
Fri, 22 June 2012 15:52  |
|
No you do not, but you will need quite a few. If you look at the data
tools jars you can remove any that you know you will not use. ie if you
are not using db2 remove those jars.
Jason
On 6/22/2012 7:22 AM, Anna T. wrote:
> Do we need aaaaaaaaaaaaaall the jars in
> C:\BIRT\birt-runtime-3_7_1\ReportEngine\lib to run a simple report?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02198 seconds