I’m using JasperReports with JavaBeans (I need to print reports in a application that uses Hibernate). Now I can work out Beans collections and use them in JasperReports, but sometimes I wonder if there is a way to access bean properties without it being a collection. What I mean is that I use JRBeanCollectionSource as a source for the various subReports. Suppose I’ve a list of People and each of them has a Car property. Now is there a way to access directly car properties without seeing it as a collection?
I’m using JasperReports with JavaBeans (I need to print reports in a application that
Share
You could try pulling the property out of the Bean and putting in a different DataSource like for example JRMapCollectionDataSource.
This would mean not having to deal with the whole Bean collection each time.
Here is some sample code for constructing a DataSource.