Reporting > Native reporting system > How to use subreports > Example 6: Pass DDID by parameter
  
Example 6: Pass DDID by parameter
This allows the subreport to be written so that the current item found by the parent report can be used wherever you want, in this case the final level.
REPORT "main: ddid by param example"
ID 48038
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
TABULAR 1
{
SELECT "Name" LEGEND "Performer"
WHERE Class = Definition
WHERE "Type Number" = 1367
ORDERBY "Name"
SUBREPORT "Subreport: ddid by param"
{
DDIDBYPARAM TRUE
}
}
}
REPORT "Subreport: ddid by param"
ID 60715
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 1 "Subreport: ddid by param" }
TABULAR 1
{
SELECT "Name" LEGEND "Activity"
WHERE Class = Definition
WHERE "Type Number" = 1326
ORDERBY "Name"

JOIN
WHERE REFERENCEDBY = "Activity"
JOIN

SELECT "Name" LEGEND "APBP"
WHERE Class = Definition
WHERE "Type Number" = 1380
ORDERBY "Name"

JOIN
WHERE REFERENCES = "Performer"
JOIN

WHERE Class = Definition
WHERE "Type Number" = 1367
WHERE "Identity" = SASUBDDID
}
}
Related topics
Report specification requirements
Example 1: 1-level main with 1-level subreport
Example 2: Multi-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 7: Subreport by property and class, type restriction
Report output differences
Sample subreport files
Parent topic
How to use subreports