Home
Analytics
What are the steps to run Birt latest in Eclipse Juno
Nandakumar
Hi,
I am try to run my birt report in Birt 4.2.0 runtime environment. But I have run birt in Eclipse Galileo with JSF 1.2. But how can i run the same report in the new birt environment. I am very confused. So please let me know what are the necessary configurations should be done when run the Birt 4.2.0 with Eclipse Juno and Jboss 6.1.0 final. My birt supporting libraries are placed in the lib folder under Jboss 6.1.0 final server. When i need to change that location or any other configuration should be done to run that Report. I don't know whether i need to use Viewer to see report. In my old version i am using <birt:birtWrapper> tag to show the report in the JSF page. Then here i don't know how to show that report in the JSF page. Can you help me to trigger out this issue. I am very suffered due to this issue. Thanks in advance. And one more doubt In my older version i am passing parameter through <f:param> tag to birt report. But now i can't. Instead of passing parameter i will pass that parameter into the map and i will pass that map to the report. And one more thing through java code only we need to initialize Birt Engine and passing parameters. Is any other easy way to show using JSF page itself like older version? Let me know about this Birt 4.2.0 latest version. I have attached my method which is used to Intialize or create this birt right. I am passed 4 parameters in this method. One is Map which is used to passes parameter using map. Second one is Path of the report design page. Third one is format which is used to create that report like pdf, html, xls. Fourth one is filename which is used to create attachment with that filename.
Find more posts tagged with
Comments
mwilliams
You might take a look at kclark's blog on JSF 2.0, if you're looking to upgrade your JSF, too:
http://www.birt-exchange.org/org/forum/index.php/blog/45/entry-442-using-jsf-2-0-with-birt/
The only difference I would think you'd have to do with the old JSF with moving to the newer version of BIRT would be to just remove the BIRT HOME stuff. That should be the only difference for the runtime code. If you wanted, you can still get the OSGi runtime with 4.2. It's a separate download on the eclipse.org/birt download page. It should work exactly how you were working back with the old runtime.
Nandakumar
Hi,
Thanks for your reply. Without integrating with JSF2.0 i can able to run Birt 4.2.0 from java class. It is working fine for the normal JDBC datasource but with scripted datasource i can't run the report. It is throwing an exception that Event handler classes are not found. Can you say how i can run this Birt 4.2.0 with Scripted datasource, Whether i need to do any changes for scripted datasource from old to new version.
Below is the code i used to export the report and i have attached the error log.
Code used:
~~~~~~~~~~
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
EngineConfig config = new EngineConfig();
Platform.startup(config);
String reportEngineFactory = IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY;
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(reportEngineFactory);
IReportEngine birtEngine = factory.createReportEngine(config);
IReportRunnable design = birtEngine.openReportDesign(designPath);
IRunAndRenderTask task = birtEngine.createRunAndRenderTask(design);
RenderOption options = null;
if (reportFormat.equals("pdf"))
{
response.setContentType("application/pdf");
options = new PDFRenderOption();
options.setOutputFormat("pdf");
options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
}
else if (reportFormat.equals("xls"))
{
response.setContentType("application/vnd.ms-excel");
options = new EXCELRenderOption();
options.setOutputFormat("xls");
options.setOption(IRenderOption.EMITTER_ID, org.eclipse.birt.report.engine.emitter.prototype.excel");
task.setEmitterID("org.eclipse.birt.report.engine.emitter.prototype.excel");
}
else if (reportFormat.equals("html"))
{
options = new HTMLRenderOption();
options.setOutputFormat("html");
}
OutputStream writer = response.getOutputStream();
options.setOutputStream(writer);
task.setRenderOption(options);
task.setParameterValues(paramMap);
task.run();
task.close();
writer.flush();
writer.close();
FacesContext.getCurrentInstance().responseComplete();
mwilliams
With 4.2, the jar should just need to be in the build/classpath. Where are you placing your jar?
Nandakumar
Michael,
Thanks for your reply. I was placed jar files in the Jboss lib location. Now I changed to the Classpath location. Now it is working fine Michael.
And one thing i need to know i got a exception in the Jdbc Datasource as
"SEVERE [org.eclipse.birt.report.engine.api.impl.ReportEngine] Error happened while running the report.: java.lang.NoClassDefFoundError: org/eclipse/datatools/connectivity/oda/consumer/helper/OdaDriver"
I am using Mysql database as backend. In the birt design part i have set a JNDI name to take a location of the Database. I have attached that error log. Thanks once again. Is there any jar files need to be added or any configuration should be done to run JDBC DS in Birt 4.2.0.
Regards,
Nandakumar.P
mwilliams
Can you double check to make sure you have the necessary jar for this in your path?
Nandakumar
Thanks for your reply Michael. Ya now it is working fine. I have found out some other jars to support JNDI for Birt report and putting into class path. Now it is working fine. Thanks Michael.
Regards,
Nandakumar Perumal.
mwilliams
You're welcome. Let us know whenever you have questions!