Sub-reports are a feature of the System Architect reporting system introduced specifically for System Architect Publisher. You can use sub-reports to generate a report page that not only includes information on a particular artifact (Diagram, Symbol, or Definition), but also complete reports on its properties. For example, a typical report for a Class definition lists its attributes and methods, and for each attribute and each method, a link is provided to a page that contains a full report on each attribute and method. Using sub-reports, you can create a Class definition report that has an Attribute sub-report and a Method sub-report, so that all information is presented on one page. In this lesson you add a sub-report.
An example of such a report is shown in the figure below.
To add a sub-report
1 If you want to have your report include sub-reports, add the SUBREPORT statement to the main report while you are editing it in text mode (not through the reporting system’s graphical user interface).
2 Use the code below (which reflects the figure above) as an example.
REPORT "Class Report" ID 53008 { SETTING { PAGESIZE -1", 0.00 } SETTING { REPORTFORMAT 4 } FIELD "Description <- Description" { SOURCE PROPERTY "Description" LENGTH 500 TYPE MEMO LEGEND "Description" } FIELD "Stereotype <- Stereotype" { SOURCE PROPERTY "Stereotype" LENGTH 20 TYPE CHARACTER LEGEND "Stereotype" } FIELD "Package <- Package" { SOURCE PROPERTY "Package" LENGTH 90 TYPE CHARACTER LEGEND "Package" } TABULAR 1 { SELECT "Name" LEGEND "Invisible", SAUsrProps, "Description <- Description", "Stereotype <- Stereotype", "Package <- Package" WHERE Class = Definition WHERE Type = "Class" WHERE "Identity" = "SWGDDID" SUBREPORT "Class Attributes" { } SUBREPORT "Class Methods" { } SUBREPORT "Class Contained In Diagrams" { } } } REPORT "Class Attributes" DESCRIPT "Attributes" ID 9673 { SETTING { PAGESIZE -1", 0.00 } SETTING { HEADER 1 "Class Definition" } SETTING { REPORTFORMAT 4 } FIELD "Description <- Description" { SOURCE PROPERTY "Description" LENGTH 1500 TYPE MEMO LEGEND "Description" } FIELD "Access <- Java Attribute Access" { SOURCE PROPERTY "Java Attribute Access" LENGTH 20 TYPE CHARACTER LEGEND "Access" } FIELD "Pre-Type <- Pre-Type" { SOURCE PROPERTY "Pre-Type" LENGTH 20 TYPE CHARACTER LEGEND "Pre-Type" } FIELD "Post-Type <- Post-Type" { SOURCE PROPERTY "Post-Type" LENGTH 20 TYPE CHARACTER LEGEND "Post-Type" } FIELD "Type <- Type" { SOURCE PROPERTY "Type" LENGTH 90 TYPE CHARACTER LEGEND "Type" } TABULAR 1 { SELECT "Name", SAUsrProps WHERE Class = Definition WHERE Type = "Class" JOIN WHERE RELATION = "uses" JOIN SELECT "Name", SAUsrProps, "Description <- Description", "Access <- Java Attribute Access" LEGEND "Visibility", "Pre-Type <- Pre-Type" LEGEND "Pre-Type", "Post-Type <- Post-Type" LEGEND "Post-Type", "Type <- Type" WHERE Class = Definition WHERE Type = "Class Attribute" } } REPORT "Class Methods" DESCRIPT "Methods" ID 34702 { SETTING { PAGESIZE -1", 0.00 } SETTING { HEADER 1 "Class Definition" } SETTING { REPORTFORMAT 4 } FIELD "Description <- Description" { SOURCE PROPERTY "Description" LENGTH 4074 TYPE MEMO LEGEND "Description" } FIELD "Access <- Java Method Access" { SOURCE PROPERTY "Java Method Access" LENGTH 20 TYPE CHARACTER LEGEND "Access" } FIELD "Return Pre-Type <- Return Pre-Type" { SOURCE PROPERTY "Return Pre-Type" LENGTH 20 TYPE CHARACTER LEGEND "Return Pre-Type" } FIELD "Return Post-Type <- Return Post-Type" { SOURCE PROPERTY "Return Post-Type" LENGTH 20 TYPE CHARACTER LEGEND "Return Post-Type" } FIELD "Return Type <- Return Type" { SOURCE PROPERTY "Return Type" LENGTH 90 TYPE CHARACTER LEGEND "Return Type" } TABULAR 1 { SELECT "Name" LEGEND "Invisible", SAUsrProps WHERE Class = Definition WHERE Type = "Class" JOIN WHERE RELATION = "uses" JOIN SELECT "Name" LEGEND "Name", SAUsrProps, "Description <- Description", "Access <- Java Method Access" LEGEND "Visibility", "Return Pre-Type <- Return Pre-Type", "Return Post-Type <- Return Post-Type", "Return Type <- Return Type" WHERE Class = Definition WHERE Type = "Method" } } REPORT "Class Contained In Diagrams" DESCRIPT "Contained In Diagrams" ID 27627 { SETTING { PAGESIZE -1", 0.00 } SETTING { HEADER 1 "Class Definition" } SETTING { REPORTFORMAT 4 } TABULAR 1 { SELECT "Name" LEGEND "Invisible", SAUsrProps WHERE Class = Definition WHERE Type = "Class" JOIN WHERE RELATION = "defines" JOIN WHERE Class = Symbol JOIN WHERE RELATION = "contained in" JOIN SELECT "Name" LEGEND "Name", "Type", SAUsrProps WHERE Class = Diagram } }
You have create a sub-report and now you can specify the starting report.