Close

Hibernate / Jasper Report Integration

I am looking into Hibernate / Jasper report integration. It seems that Jasper Report has not initially been compatible with Hibernate but only from it later versions. This make life harder when it comes to the nature of Jasper Report, whom as a novice I believe treats everything as a row and should be inputed with rows of data to be able to generate the report.

In different sources, I have come across solution on how to integrate Hibernate with Jasper reports. These are what I have found.

In 1 author has mentioned that:

However, when the Hibernate query returns tuples of objects (each tuple as an array, each array as an element in the returned List), things get a little tricky. Jasper needs a way to reference each object in the array by a field name. This class is a good solution, but at this time you are required to pass an array of field names matching the results of the query.

And he/she is suggesting that it is a helper class needed to interpret those results and transfer them into usable data for Jasper.
John is also suggesting the same solution for using Hibernate with Jasper; You can find more tips on optimization of Hibernate / Jasper integration in his post as well.
This is also a really good start for Jasper, a really nice Hello world tutorial for Jasper Reports.

Resources:

  1. http://community.jboss.org/wiki/UsingJasperReportsWithHibernate
  2. http://www.javalobby.org/articles/hibernatequery103/
  3. http://www.sanjbee.com/content/wp-content/uploads/2008/07/jasper.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *