Configuring & Generating BIRT Reports Dynamically
Asked Answered
D

5

13

From watching the 2-part YouTube videos and perusing the BIRT manual, my understanding of it is the the worflow goes something like this:

  • Create a new Report in Eclipse
  • Use the BIRT Report Designer (Eclipse plug-in) to design a report
  • Populate the report with Data Sources (JDBC drivers & databases) and Data Sets (specific tables)
  • Generate/export/print the report

As cool as this tool seems to be, I cannot find any documentation that leads me to believe that this is a Java tool and not an Eclipse-only tool (meaning, it has a Java API and can interact with Java apps, as opposed to a pure Eclipe plug-in which requires manual/human interaction from the Eclipse IDE.

Specifically, I want to confirm that BIRT either can or cannot do the following:

  • Configure a report (layout, UI widget placement, data sources/sets, etc.) programmatically; i.e. in the same way that JasperReport API has the iReport designer that generates JRXML, is the same true for BIRT?
  • Kick off a report "generation" through a Java API whereby data gets read-in realtime and populates the report and the report can be sent out or stored on a file system
  • Create HTML and PDF versions of the same report
Dionysius answered 7/7, 2012 at 2:34 Comment(2)
Did you have a look at the book "Integrating And Extending BIRT" and especially the Part 4 on How to integrate BIRT into Applications ?Simply
See: vogella.com/tutorials/EclipseBIRT/article.htmlSabian
L
17

Answers to your questions:

  1. Yes. BIRT may not be as powerful as JasperReports, but it can achieve most of the common needs. BIRT designer generates a .rptdesign file similar to JRXML in JasperReports.

    About your question: almost everything is possible to achieve programmatically in BIRT. BIRT Report Engine APIs is the best source for you to get started with all the functionalities you have mentioned. It has good examples given for every functionality.

  2. Not sure. BIRT usually fetches pre-saved data from DB and generates the report. You could though see the real time data representation (in the form of a flash chart may be) with the help of some external libraries (See if this thread and this example helps). But I am not aware of a direct way of converting the real time data to PDF/HTML report. You will have to find some hack(s).

  3. Yes of course. Refer the APIs. To be specific, irendertask.

Sources to get more information/answers:

  1. There are several example reports given on the website. A quick glance through them might give you more insights.

  2. For discussions and troubleshooting, refer eclipse community forum and BIRTExchange (heavily used by BIRT users).

  3. BIRT: A Field Guide to Reporting is an excellent book. I've used it myself from time to time.

Lavabo answered 11/7, 2012 at 23:11 Comment(1)
If I had to choose between jasper and BIRT which one will be good ? I want to use it with spring boot (Java) IDE IntelliJ Idea. There are 2 major components. 1 ) designer 2) Runtime Engine. We can create design from Designer and then export .rptdesign. I dont under stand how we can use birt engine if you could go through this steps wiseStowaway
H
4

I can confirm that the two BIRT components you are interested in using (BIRT Design Engine and Report Engine) will work in a pure-Java context and are deployable without Eclipse. I have deployed BIRT reports to run out of standalone Tomcat servers as well as Pentaho BI Server, and have exercised report definitions at the command line using shell scripts (no Eclipse involved).

Answers to your questions:

  1. Configure a report programmatically: use the Design Engine API. I am not familiar with the Jasper Reports API so cannot comment on whether the BIRT method is similar, but the example code provides a good illustration. In particular, note lines 120-133 which add and manipulate widgets in the report, and how line 136 calls saveAs to save the report design file.

  2. Generate a report in realtime: use the Report Engine. The sample code for the IRunAndRenderTask may be the most useful for you at first, but the engine has the ability to separate the data processing (extract and aggregate) of the report from the rendering and paging. I believe the examples focus on running reports from a Servlet, but it is easy to extract that logic from the servlet container logic.

  3. Create both HTML and PDF versions: easily handled in the Report Engine via the IRenderTask. Once you've been through all the other setup work, changing the output format to produce PDF vs HTML is something of a joy. In my experience, it just works.

I found it useful to start out with a very simple Java class (adapted from the very old code here) to run a test report, called from the command line.

Hanni answered 11/7, 2012 at 19:51 Comment(0)
P
1

you can use the report engine API to configure reports: http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#ireportrunnable

You can create HTML or PDF versions of a report by setting a variable in the url to generate the report or if using the report engine programmatically:

http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#irendertask

We use Eclipse to build and design reports. The report engine is deployed as part of a reports_war, the war has its own connection to the database. Our Java based web application uses urls to interact with the report templates (variables are set in the urls).

The BIRT Exchange is a good place for more information

Plumlee answered 10/7, 2012 at 3:58 Comment(1)
If I had to choose between jasper and BIRT which one will be good ? I want to use it with spring boot (Java) IDE IntelliJ Idea. There are 2 major components. 1 ) designer 2) Runtime Engine. We can create design from Designer and then export .rptdesign. I dont under stand how we can use birt engine if you could go through this steps wiseStowaway
J
0

There is not much difference between Birt and jasper as designing point of view except birt have eclipse plugin.

1)yes,you can configure it by java program or methods.

2)yes,this is possible.

3)yes again for export your report in different formats is easy for birt report by java

Johnsson answered 8/11, 2013 at 12:0 Comment(1)
If I had to choose between jasper and BIRT which one will be good ? I want to use it with spring boot (Java) IDE IntelliJ Idea. There are 2 major components. 1 ) designer 2) Runtime Engine. We can create design from Designer and then export .rptdesign. I dont under stand how we can use birt engine if you could go through this steps wiseStowaway
J
-1

BIRT is a good and easy tool fro report generating.

  • you can design your pages in BIRT. -
  • Create datasets and can pass the values from your web pages to your BIRT design using jsp tag lib. BIRT fulfills all your requirement. Its so easy to use. first i use jasper, then tried crystal atlast Birt gies the output. tag lib

i refer this link to view BIRTVIEWVER in my web page. PDF creation is so perfect in BIRT. You can generate PDF, DOC, HTML also.

you can pass values to your birt . while creating dataset there is option for passing params.

to do all this you have to install BIRTREPORT inyour eclipse BIRT Report designer

Janessajanet answered 10/7, 2012 at 8:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.