Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate BIRT in existing webapp

Tags:

java

tomcat

birt

I would like to add the BIRT reporting engine to an existing webapp in Tomcat. I don't need the BIRT viewer, I really only want to be able to run the reports from a url like http://localhost:8080/birt/output?__report=test.rptdesign&sample=my+parameter and use the different export options pdf, xls, doc, html.

The integration guides I've found so far all include the viewer and writing my own servlets to handle different formats.

I was hoping someone knew simply which servlet mappings from the report-engine web.xml file I needed and which jars I would need to include from the lib directory for this barebones BIRT implementation in existing webapp.

like image 324
egerardus Avatar asked Jan 24 '12 00:01

egerardus


People also ask

Is BIRT Reporting free?

the usage of BIRT is free of all cost also on enterprise usage. The only cost you have are internal cost for the report development but the software and components are free. You cann also add for example special plugins of you requirements and add these to your BIRT-installation.

How do I open BIRT files in Eclipse?

BIRT is a perspective within Eclipse. To open it, use the Window item on the Eclipse main menu. Choose Open Perspective, then Report Design.


1 Answers

I was hoping someone knew simply which servlet mappings from the report-engine web.xml file I needed and which jars I would need to include from the lib directory for this barebones BIRT implementation in existing webapp.

I didn't necessarily want to write my own servlet I just wanted to integrate the existing reporting runtime from its own standalone webapp (here under the "runtime" button) into my existing webapp, so that I don't have to distribute 2 webapps to support running BIRT reports. Sorry if that wasn't clearer.

I did work this out though, in the simplest possible fashion, in case anyone has a similar question (using BIRT runtime 3.7.1):

  1. All you need is the following servlet mapping added to your own webapp\web-inf\web.xml file:

    <!-- Engine Servlet -->
    <servlet>
        <servlet-name>EngineServlet</servlet-name>
        <servlet-class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>EngineServlet</servlet-name>
        <url-pattern>/output</url-pattern>
    </servlet-mapping>
    
  2. Include all jars from the web-inf\lib directory of the runtime into your own webapp\web-inf\lib directory.

You can then run .rptdesign files using the output BIRT report url from your own webapp, and specifying whatever format you want, e.g.:

http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=pdf
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=html
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=xls
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=doc
http://localhost:8080/myOwnWebapp/output?__report=test.rptdesign&__format=ppt
like image 160
egerardus Avatar answered Oct 10 '22 20:10

egerardus