开发者

Alternative to subreports in JasperReports

开发者 https://www.devze.com 2023-03-28 11:07 出处:网络
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 solutionis not satisfacto

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 impor开发者_如何学Gotant 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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号