Reporting : Native reporting system : How to use subreports : Example 2: Multi-level main with 1-Level subreport
  
Example 2: Multi-level main with 1-Level subreport
Here is what happens if you add another level to the end of the main report after running the subreports.
The only difference other than the report name is the new entries in bold:
REPORT "main: 1 level with 2 subs (1 level, 1 level) then another level"
ID 52510
{
FONT "Font4" { NAME "Courier" HEIGHT 12 }
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT ENGLISH }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 1 "OV-03 Need Line" }

TABULAR 1
{
SELECT "Name" LEGEND "Need Line"
WHERE Class = Definition
WHERE "Type Number" = 1402 REM "Need Line"
ORDERBY "Name"
SUBREPORT "Subreport: OV-03 Need Lines Working - PerformerSource" { }
SUBREPORT "Subreport: OV-03 Need Lines Working - PerformerTarget" { }
JOIN
SELECT Relation
ORDERBY Relation
JOIN

SELECT "Name" LEGEND "Related"
ORDERBY "Name", "Identity"
}
}
The new columns requested by the main report appear before those presented by subreports:
This also demonstrates what happens when the main report produces more rows. The subreport starts presenting its data from the row that it was invoked for. When the subreport is complete, presentation will continue from the next appropriate row.
Related topics
Report specification requirements
Example 1: 1-level main with 1-level subreport
Example 3: 1-level main with multi-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