You can use subreports. For this parameters must be set by opening the Properties of the subreport in the main report. The following parameters have to be set:
•Possible parameters that limits the results of the query in the subreport to the relevant information of the master project. A common parameter is P_PJT_CODE for the project. In the main report this is filled with the project code with the help of for example ‘$F{PJT_CODE}’.
•The Subreport Parameters need to have the next values:
•REPORT_RESOURCE_BUNDLE: this parameter should be filled with ‘$P{REPORT_RESOURCE_BUNDLE}’. This will ensure that the report will get the same translations as the main report.
•REPORT_LOCALE: this parameter should be filled with ‘$P{REPORT_LOCALE}’. This will ensure that the report will get the same translations as the main report.
•The field Connection Expression: this should be filled in with ‘$P{REPORT_CONNECTION}’, to assure that the subreport shares the same database connection with the main report.
•The location of the subreport is either filled with the URL of the report, for example, ‘http://SERVER/tbubs/bubs_custom_sub1.jasper’, or is calculated via a column in the query. The use of a query is recommended since the report will take transparently the appropriate report file in any environment. The preferred name for this column is SUBREPORT<number>_URL and the value will be filled with ‘$F{SUBREPORT<number>_URL}’.