简体   繁体   中英

Alternative to subreports in JasperReports

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.

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM