| Auszug |
|---|
|
Nuclos subreports: JasperReport parameter, REPORT_DATA_SOURCE, JRNuclosDataSource, detail band, Run to Bottom, nuclos-reportapi.jar. |
Language: Deutsch · English
Subreports
Display dependent records in a report – upload subreports, embed them via a parameter and feed them with data sources.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
What is a subreport?
A subreport displays dependent records (e.g. order positions of an order) inside a main report. As JasperReports does not embed subreports, they are stored separately from the main report.
Uploading a subreport
In the subreports sub-form you upload the subreport file (*.jrxml or *.xml) and specify a parameter name. The subreport is passed to the main report via this name.

Subreport assignment with parameter name.
Using it in the report design
In the main report create a parameter with the name given above and type net.sf.jasperreports.engine.JasperReport. In the subreport properties set:
| Property | Value |
|---|
| Subreport Expression | $P{<parametername>} (e.g. $P{SUBREPORT_A}) |
| Expression Class | net.sf.jasperreports.engine.JasperReport |
| Connection type | Use a datasource expression |
| Data Source Expression | see code example below |
Data source of the subreport
Add a parameter REPORT_DATA_SOURCE to the subreport properties with the following expression:
| Codeblock |
|---|
|
((org.nuclos.server.report.api.JRNuclosDataSource)$P{REPORT_DATA_SOURCE}).getDataSource("<Name der Datenquelle in Nuclos>") |
The subreport must be placed in the detail band of the parent report so that connection and context information is passed. Defined data-source parameters (e.g. intid) are filled automatically per main record from its fields.
| Info |
|---|
| title | Testing in the designer |
|---|
|
For test compilation in Jaspersoft Studio, add nuclos-reportapi.jar (part of the distribution) to the class path. |
If a whole form is used as a subreport: (1) maximise the executing band to page size, (2) set the subreport property Run to Bottom. Especially important with the last page footer.
| Warnung |
|---|
|
Expansion behaviour: if a subreport is used in the title, page/column header or group header/footer, the property position type = float must be set. |
For building a sub-sub-report see Subreport within a subreport.
Related pages
Subreport in the designer
Step by step.
Open →
Subreport within a subreport
Deeper hierarchy.
Open →