Templates and Instances Listing
This example shows how Crystal Reports can be used to produce two very simple reports. One report lists the Group Templates that are configured on a system, and the other report lists the Instances of those templates, and their location within the database. (You can display a list of Instances that reference an individual template, by using the Display References option in ViewX, but these reports are useful for displaying information on all of the Templates and Instances on your system.)
Example:
A report is produced that lists the Group Templates that exist on a system. It also contains notes that specify the type of equipment that each template represents.
The report uses the CTemplate database table. The following fields from the CTemplate table are used within the report:
- Name—The name of the template.
- NoteText—The user notes that have been manually entered within ClearSCADA for each template. (Notes are entered for each template by right-clicking on the template entry in the Database Bar, choosing the ‘Notes’ option from the context sensitive menu and manually entering free-form text.)
- Name—The name of the instance.
- FullName—The full database path for the Instance.
- Name—The name of the template. (This appears as ‘Template Used’ within the report).
The entries in the report are sorted alphabetically, by template name. (Sorting is specified in Crystal Reports by selecting the ‘Report’ menu option, choosing the ‘Record Sort Expert’, specifying the required Sort Field (in this case ‘Name’) and selecting the required sort order.)
A second report lists the Group Instances in the same system. The entries are sorted alphabetically, firstly by Template name order and then by Instance name order.
From looking at the ‘Template Used’ column, engineers can assess which Instances will be affected if configuration changes are made to a particular Template. They can therefore assess the Instances for which additional configuration may be required if the Template configuration is changed.
This report references two database tables:
The CTemplateInstance database table, from which the following fields are used in the report:
The CTemplate database table, from which the following field is used in the report:
The records in both tables were matched by linking the Id field in the CTemplate table to the TemplateId field in the CTemplateInstance table.
As with the Group Templates report, the field titles were modified within Crystal Reports to give them more meaningful names. This was done by right-clicking on each field title, selecting the ‘Edit Text object’ from the pop-up menu, and entering the required text.
Further Information
Group Templates and Group Instances: see Group Templates and Group Instances in the ClearSCADA Guide to Core Configuration.
Specify the Links Between Multiple Tables.
For a further example that demonstrates how to use the Record Sort Expert, see Specify the Order in which Data is Displayed on a Report.