Reporting > Native reporting system > How to use subreports > Example 3: 1-level main with multi-level subreport
  
Example 3: 1-level main with multi-level subreport
This example shows what happens if you add a level to the first subreport to the report shown in Example 1: 1-level main with 1-level subreport.
The only changes to the subreport besides the name are in bold:
REPORT "Subreport: OV-03 Need Lines Working - PerformerSource followed by another level"
ID 52514
{
FONT "Font4" { NAME "Courier" HEIGHT 12 }
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT ENGLISH }
SETTING { PAGESIZE -1", 0.00 }

TABULAR 1
{
ORDERBY "Name"

JOIN
WHERE REFERENCES = "performerSource"
JOIN

SELECT "Name" LEGEND "Performer Source" LEGENDFONT Font4, "Type" LEGEND "Performer Type"
WHERE Class = Definition
WHERE "Type Number" = 1372, 1373, 1374, 1367, 1375, 1376, 1377 REM "Performer Source"
ORDERBY "Name"

JOIN
SELECT Relation
ORDERBY Relation
JOIN

SELECT "Name" LEGEND "Related", "Identity" LEGEND "Related Id"
ORDERBY "Name", "Identity"
}
}
The main report was duplicated and the new subreport name referenced.
The second Performer Type column has been excluded from this snapshot.
The Relation, Related and Related Id columns now appear before the columns of the second subreport:
This graphic is described in the surrounding text.
This also shows what happens if a subreport presents more rows than the invoking report.
The provided comparison report that does not use subreports, but has the same execution structure, gets the same information except for ov-02_NL3 which is missing because it has no source:
This graphic is described in the surrounding text.
Related topics
Report specification requirements
Example 1: 1-level main with 1-level subreport
Example 2: Multi-level main with 1-Level subreport
Example 4: Multi-level main with multi-level subreport
Example 5: Using subreports at multiple levels
Example 6: Pass DDID by parameter
Example 7: Subreport by property and class, type restriction
Report output differences
Sample subreport files
Parent topic
How to use subreports