Lesson 4: Modify reports for use with System Architect Publisher
You use the System Architect's reporting system to create reports for use with System Architect Publisher. You can use the reporting system's graphical user interface to initially design the report. After you run a draft of the report and are satisfied with the output, you can modify the code of the report in a text editor for your purposes. In this lesson you modify a sample report.
Prerequisite
Reports to be used with System Architect Publisher are created with System Architect's reporting system. You can use the reporting system's graphical user interface to initially design the report. After you have run a draft of the report and are satisfied that it is providing the proper output, you need to modify the code of the report in a text editor.
Before using a report created with System Architect's reporting system's graphical user interface, you must make modifications to its code so that it will work with System Architect Publisher.
Set the report type to XML Output.
To work with System Architect Publisher, the report must be set to generate XML output.
In the System Architect reporting system graphical user interface, set the Report Type to XML. (To do this, you also need to specify an Output file and a Style Sheet in the reporting system's user interface. This information will later be removed from the report in text edit mode, because System Architect Publisher specifies its own output file and XML stylesheets.)
This is the same as adding the code SETTING { REPORTFORMAT 4 } to the top of the report in text edit mode.
Text edit the report to add an identity command.
1 Open a report in a text editor by performing one of these actions:
•In System Architect reporting system interface (accessed by selecting Reports, Report Generator), select report and choose Report, Text Edit Report.
•Use Windows Explorer or equivalent to access the report file, and open it in any text editor (such as Notepad).
•If you are in System Architect Publisher, you can access the textual code for any report within its Specify Reports tab. Right-click any report in the Available Reports list box, and select Edit.
2 Within each report that will be used with SA Publisher, specify the following code in the report wherever a class and type is declared:
WHERE "Identity" = "SWGDDID"
This should come after the 'Where' clause, as shown in the example below.
Text Edit the Report to Delete Specific Statements that Reporting System User Interface Adds
As mentioned in step 1 above, if you specify the report as an XML report in System Architect's reporting system user interface, code is added to the report specifying the output file and XML stylesheet of the output. Since this will contradict with information that you will specify in SA Publisher, you must remove these lines of code from the report.
•Remove all lines in the report that specify an output file (OUTPUTFILE) and an XML stylesheet (STYLESHEETFILE), as the example below illustrates.
REPORT "Package Report" ID 60324 { SETTING { PAGESIZE -1", 0.00 } SETTING { HEADER 1 "Class Definition" } SETTING { TRAILER 1 "as of ", "date", Page ", "#pg#" } SETTING { REPORTFORMAT 4 } - Has to be set to REPORTFORMAT of '4' to enable XML output SETTING { OUTPUTFILE "C:\Program Files\UNICOM Systems\output\default.htm" } SETTING { STYLESHEETFILE "C:\Program Files (x86)\UNICOM Systems\System Architect Suite\System Architect\Reports\Stylesht\Default.xsl" } FIELD "Description <- Description" { SOURCE PROPERTY "Description" LENGTH 1200 TYPE MEMO LEGEND "Description" } TABULAR 1 { SELECT "Name" LEGEND "Invisible", SAUsrProps, "Description <- Description" WHERE Class = Definition WHERE Type = "Package" WHERE "Identity" = "SWGDDID"- This needs to be added manually to publish one particular item. } }
Text edit diagram reports to generate picture of diagram to SVG graphic
To specify that a diagram report generate the diagram to a picture, represented in SVG format, you must add the DIAGRAM command to the report. An example of use of the DIAGRAM command is shown in the report below.
REPORT "Diagram Report" ID 38458 { SETTING { PAGESIZE -1", 0.00 } SETTING { HEADER 1 "Diagram Report" } SETTING { REPORTFORMAT 4 } FIELD "Linked Documents <- Linked Documents" { SOURCE PROPERTY "Linked Documents" LENGTH 1200 TYPE MEMO LEGEND "Linked Documents" } FIELD "Description" { SOURCE PROPERTY "Description" LENGTH 4074 TYPE MEMO } TABULAR 1 { SELECT "Name", SAUsrProps WHERE Class = Diagram WHERE "Identity" = "SWGDDID" SUBREPORT "Parent Diagram" { } DIAGRAM JOIN WHERE RELATION = "contains" JOIN PARTIAL SELECT "Name", SAUsrProps WHERE Class = Symbol SUBREPORT "Child Diagrams" { } JOIN WHERE RELATION = "defined by" JOIN SELECT "Name", "Linked Documents <- Linked Documents", SAUsrProps WHERE Class = Definition JOIN WHERE RELATION = "uses" JOIN SELECT "Name", SAUsrProps, "Description" WHERE Class = Definition WHERE Type = "Hyperlink" } }
Note .SVG stands for scalable vector graphic format. Diagrams presented in .SVG format enable you to zoom in and out of the diagram in the website output, just as you can in System Architect. Another advantage of SVG is that you search for text with the diagrams. To view SVG files, your browser needs the Adobe SVG viewer plug-in. If the viewer is not installed, you can download it for free from the website.