globe with meridians Language: Deutsch · English

hammer and wrench Subreports

Display dependent records in a report – upload subreports, embed them via a parameter and feed them with data sources.

HOW-TO APPLICATION DEVELOPER UPDATED: JUL 2026 APPLIES TO NUCLOS 4.2026.X

On this page

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:

PropertyValue
Subreport Expression$P{<parametername>} (e.g. $P{SUBREPORT_A})
Expression Classnet.sf.jasperreports.engine.JasperReport
Connection typeUse a datasource expression
Data Source Expressionsee code example below

Data source of the subreport

Add a parameter REPORT_DATA_SOURCE to the subreport properties with the following expression:

((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.

Testing in the designer

For test compilation in Jaspersoft Studio, add nuclos-reportapi.jar (part of the distribution) to the class path.

LastPageFooter in a subreport

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.

Position type

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

memo Forms


Forms.

Open →

printer Subreport in the designer


Step by step.

Open →

clipboard Subreport within a subreport


Deeper hierarchy.

Open →

  • Keine Stichwörter