Birt report with hibernate - java

Hi I'm trying to find a way to create birt reports with datasets based on a hibernate data source. However, I downloaded eclipse report designer and related plugins, but can't seem to find an option for hibernate data source. Was this functionality taken out?
I have gone through a couple of links and either they are old libraries or the integration is done via seam. The only reasonable examples i found are using Scripted data source to access hibernate POJOs. But nothing on how to access hibernate entities directly from the report at least in the latest versions of birt.
Or is there something that I'm missing?

You can check my approach based on POJO data source (without using scripting data source). I finally found some time today to describe it here.

Related

Merging multiple extent html reports using ExtentXReporter

I have multiple projects using extent reports to generate html reports and now the problem im running into is integrating these reports.
More or less im looking for a report similar to this
http://relevantcodes.com/Tools/ExtentReports2/ExtentMerge.html
I have report1.html, report2.html ... to be merged to a single html file
Creating single instance of extentrepot won't be solving this issue as these are completely different projects running as part of regression
Can anyone please direct me to an example/poc to integrate this using Extentxreporter
I have mongodb and nodejs installed
The merge utility is no longer available or supported. The recommended solution is to use the Klov server.
Link: https://github.com/extent-framework/klov-server

How to print a report in Java?

I came from C#.
.NET offers a reporting tool (Crystal Report) to print reports.
I'm using a JTable populated by a source.
How do I print the records from the JTable without using jTable.print()?
How can I control the layouting?
Is the only way to print reports in Java is to use java.awt.print and javax.print?
BIRT allows you to handle data from POJO (Plain Old Java Object) datasource, consult BIRT developer channel on youtube, there is a tutorial about that.
Dynamicreports is suitable for the purpose you had mentioned. It is build on top of Jasperreports and it is simpler to use than Jasper reports.
http://www.dynamicreports.org/
You can find the examples here: http://www.dynamicreports.org/examples/examples-overview

Avoid Data Cache after generating report with embedded Pentaho Report Designer Classic Engine

I'm using Vaadin 6.8 and pentaho classic engine 5.0.1 embedded to my application. I've successfully generated the reports in the formats required and with parameters established. The issue comes when I noticed that after generating the report, there is something like a data-cache that doesn't allow me to get updated data from the datasource (MySQL jdbc in report definition). The report generator is generating new files, but the data is not updated because of this cache, it means that, different files are generated with the same data content, even when I update it directly in the database. I'm forced to close my vaadin application and generate the reports again to get the update on the report data, but I cannot close the user session every time to get it working as requirement.
After many days I've found this, where it explains that disabling data-cache is enough to avoid that problem:
http://forums.pentaho.com/showthread.php?82765-Engine-3-8-disable-data-caching
I've tried to set that config-key via my java classes, but I don't know how to set that key, so I decided to search more about this, and in the next link, says that is possible but using a BI-server.:
http://infocenter.pentaho.com/help/index.jsp?topic=%2Fperformance_tuning_guide%2Ftopic_reporting_caching.html
My application runs alone in a server, and I can't use the BI-server as I only need the report generator, that's the purpose of using embedded report generator. How can I set that config-key via Java classes or in a way that I can handle all in my Java application? or how can I avoid data-cache on report generation with classic engine?
The only way I've found to avoid data-cache without a global config-key is to define data-cache = false at Pentaho 's Report Designer Master Report attributes while editing a report.

Configuring & Generating BIRT Reports Dynamically

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
Answers to your questions:
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.
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).
Yes of course. Refer the APIs. To be specific, irendertask.
Sources to get more information/answers:
There are several example reports given on the website. A quick glance through them might give you more insights.
For discussions and troubleshooting, refer eclipse community forum and BIRTExchange (heavily used by BIRT users).
BIRT: A Field Guide to Reporting is an excellent book. I've used it myself from time to time.
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:
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.
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.
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.
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
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
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

How to generate orm mapping classes from sql schema in Java

I have an existing sql schema file for db. Is it possible to generate and re-generate when needed DAO's entities and all other required helper/client classes to access it? I don't mind what will it be -- hibernate, other jpa or something else.
Asuming you/others are still looking for a solution:
I just got the same problem and got it working in Eclipse (slightly different) as follows:
created JPA Project and downloaded & added user library in the wizard
Also wanted to give a schema-sql-file as input but instead found a way to take an actual db as input. (That was surely much easier for the developers of the tool to process than parsing proprietary sql-script-files)
To do that "rightclick" you jpa project an there "new/other/jpa/entities from tables"
In the following Wizard you have to create a db-connection to the db whose schema you want to get as jpa-annotated POJOs (IMHO It's very intuitive..but you may ask if there is a problem)
After finishing all jpa-classes are generated from the db...saved me from a lot of dummy work :)

Categories