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
Here is what happens if we return to the original report and add a level to the first 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 2nd Performer Type column has been excluded from this snapshot.
The Relation, Related and Related Id columns now appear before the columns of the 2nd subreport:
This also demonstrates 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, obtains the same information except for ov-02_NL3 which is missing because it has no source:
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