Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Jaspersoft subreport in the designer: detail band, data source, Intid, .jasper, subreport wizard, Use an existing report.

globe with meridians Language: Deutsch · English

graduation cap Subreport in the designer

Step by step: build a subreport in Jaspersoft Studio, test it and embed it in the main report.

Status
colourBlue
titleTutorial
Status
colourBlue
titleApplication developer
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

Creating a subreport in the designer

Subreports suit tabular data or lists and can use their own data source. Here we build a subreport and test it together with the main report in the designer (example: order with order positions).

1. Create the form

Analogous to the main report. For the subreport:

  • Remove all bands except Column Header and one Detail band.
  • Adjust the detail band width to the embedding location (525 px in the example).
  • Remove all margins so the subreport blends in seamlessly.

Subreport form in the designer.

2. Create the data source

Same database connection as the main report; procedure analogous to creating a data source in the designer.

Codeblock
languagesql
Hauptreport
Warnung
titleImportant

The same parameter Intid must exist – ideally imported from the main report.

3. Insert fields & create .jasper

  • Drag&drop fields into the detail band (automatically creates static text in the column band).
  • Format number fields, e.g. #,##0.00.
  • Run the preview – on success the designer creates a <name>.jasper.

Fields in the subreport.

4. Embed the subreport in the main report

In the main form choose the Subreport component from the palette, select Use an existing report in the wizard and load the created .jasper. Then choose the data source and place the subreport.

Subreport wizard in the main report.

Info
titleBelonging

The Intid parameter exists in both forms and ensures the subreport data belongs to the main record. Make sure not every band expands automatically with the subreport.

Related pages

clipboard Subreports


Basics.

Open →

printer Creating a data source in the designer


Data source.

Open →