HTML and SAXT subreport stylesheets have been prepared to present an additional heading for the type of item being reported, if the following line is present at the start of the subreport:
SELECT "Name" LEGEND "Invisible"
You must include an ORDERBY statement at each level of the report, particularly the top level of subreports, which should cover all selections. If you do not, data can be left out in SAXT Reader results, and might mean that results appear differently if you switch to an alternative format or report execution mechanism (for example, switching between SAXT Reader and SAXT Updater).
SUBREPORT command
In a report level, you can have:
SUBREPORT "report-name" { [parameters] }
There can be more than one subreport.
The sequence dictates the sequence that the columns appear in, but note that all columns from all levels of the main report appear first, then the columns of the first subreport that was executed, and so on.
Parameters
REPORTFILE "file-name"
file-name can be specified without a path if it is in the same folder as the current report file, or with a complete drive:\path.
DDIDBYPARAMETER [ TRUE | FALSE ]
FALSE is the default. It inserts the following statement at the top of the subreport:
WHERE Identity = Identity value of the current record from the parent report
If TRUE is specified, the SASUBDDID keyword allows the use of the current Identity value from the parent report to be used to constrain subreport output.
SUBREPORTCLASS, SUBREPORTTYPE, SUBREPORTPROP
Not yet supported by SAXT Reader. See below.
SUBREPORTPROP "property" specifies that a subreport will be run for each reference of the named property. The property must be selected, but it can be given a ##invisible## legend to force it to be hidden.
SUBREPORTCLASS, SUBREPORTTYPE specify class and type numbers that must be matched for the subreport to be run. If not specified then the subreport is always run. Only one class and type can be specified. The last to be specified is what is used.
For SAXT Reader, or for an alternative layout, put the following statements at the top level of the subreport to get the equivalent behavior:
SELECT Name LEGEND "Invisible" REM "Use this legend to hide it" JOIN WHERE REFERENCES = "property" JOIN SELECT "Name" LEGEND "Name", "Class", "Type" REM "Use a legend here if you want to show the name" WHERE Class = Definition REM "Class Restriction goes here" WHERE "Type Number" = 1367 REM "Type Restriction goes here"
Using this structure gives better results, because when using two subreport statements to report on more than one property, and the first one produces no results, a cell is not skipped in the generated table.