Reporting : Native reporting system : How to use subreports : Example 7: Subreport by property and class, type restriction
  
Example 7: Subreport by property and class, type restriction
REPORT "main: class, type restriction example"
ID 48038
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 1 "main: class, type restriction example" }
FIELD "Performer" { SOURCE PROPERTY "Performer" LENGTH 4074 TYPE MEMO LEGEND "##invisible##" }
TABULAR 1
{
SELECT "Name" LEGEND "APBP", "Performer"
WHERE Class = Definition
WHERE "Type Number" = 1380
ORDERBY "Name"
SUBREPORT "Subreport: class, type restriction example"
{
SUBREPORTCLASS 3
SUBREPORTTYPE 1367
SUBREPORTPROP "Performer"
}
}
}
REPORT "Subreport: class, type restriction example"
ID 60715
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 2 "Subreport: class, type restriction example" }
TABULAR 1
{
SELECT "Name", "Class", "Type"
ORDERBY "Name"
}
}
Note In the final row, no Name, Class or Type has been reported because this APBP was related to a service definition which does not match the specified type. If the restriction is removed then it is reported:
If the SUBREPORTPROP keyword is not specified, we get the details of the APBP:
The following report shows the problem with this report structure; that cells are not skipped if a property had no content:
Note The ov05b_LocPop item near the bottom shows Performer first since it had no Activity reference.
This is the same report without the parameter, with the equivalent structure used at the top of the subreport:
REPORT "main: class, type restriction example2 comparison"
ID 48038
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 1 "main: class, type restriction example" }
FIELD "Performer" { SOURCE PROPERTY "Performer" LENGTH 4074 TYPE MEMO LEGEND "Invisible" }
TABULAR 1
{
SELECT "Name" LEGEND "APBP"
WHERE Class = Definition
WHERE "Type Number" = 1380
ORDERBY "Name"
SUBREPORT "Subreport class and type restriction example comparison A" { }
SUBREPORT "Subreport class and type restriction example comparison P" { }
}
}
REPORT "Subreport class and type restriction example comparison A"
ID 60715
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 2 "Subreport class, type restriction example" }
TABULAR 1
{
ORDERBY "Name"

JOIN
WHERE REFERENCES = "Activity" REM "Property goes here"
JOIN

SELECT "Name" LEGEND "Activity"
WHERE Class = Definition REM "Class Restriction goes here"
WHERE "Type Number" = 1326 REM "Type Restriction goes here"
ORDERBY "Name"
}
}
REPORT "Subreport class and type restriction example comparison P"
ID 60715
{
SETTING { DECIMALSEPARATOR "." }
SETTING { LISTSEPARATOR "," }
SETTING { MEASUREMENT METRIC }
SETTING { PAGESIZE -1", 0.00 }
SETTING { HEADER 2 "Subreport class, type restriction example" }
TABULAR 1
{
ORDERBY "Name"

JOIN
WHERE REFERENCES = "Performer" REM "Property goes here"
JOIN

SELECT "Name" LEGEND "Performer"
WHERE Class = Definition REM "Class Restriction goes here"
WHERE "Type Number" = 1367 REM "Type Restriction goes here"
ORDERBY "Name"
}
}
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 6: Pass DDID by parameter
Report output differences
Sample subreport files
Parent topic
How to use subreports