Reputation: 863
I am using JasperReports in my project. During the generation of reports, I am forced to retrieve data from different tables in the database. I have used subreports, but this solution is not satisfactory for me. Main reason for this is fact that for each report I have to prepare two jrxml files. For the assumptions of my project this is not effective.
Is there an alternative to subreports? If it is important I use Hibernate.
Upvotes: 0
Views: 991
Reputation: 22867
Mateusz, you can prepare data source manually in java code and pass is to the report. Sometimes the good subreport's alternative is using group(s) in report.
Upvotes: 1
Reputation: 377
At a higher level what are you trying to achieve ?
If the reason you're using subreports is to embed mulitple graphs/chart widgets that display different but related data, then an alternative way to doing this is using subdatasets
Innformation on using subdatasets can be found in iReport Ultimate Guide, but basically they are extra sub queries you can run in addition to the main report query, whose results can be access by Charts/Charts Pro widgets (see the chart data tab in these widget properties)
Upvotes: 0