Add Drawing Details and Extended Simple Source with Filters
We want to insert drawings associated with assets that the user can select upon report generation. We also want to include layers on the drawings and a heading before the drawings. To do that, we create the following elements:
An Element Group for Drawings to include the Drawing Details element with a parameter that allows excluding this part of the report during report generation
A level-2 Section Heading
A Simple Source for the Drawing system table, from which the Drawing Details element can retrieve data. We extend the source with a field for Drawing Name so that it can be used for the caption. We also add a filter for VN_ID (Asset Location) as a user parameter so that the user can select the required asset tree branch when generating the report.
A Simple Source for the Asset system table, which will be used to retrieve data for the layers of the drawings. We extend this table with a few fields required for the layers and also add a filter for VN_ID (Asset Location) as a user parameter.
The actual Drawing Details element.
See the detailed steps below:
Prerequisites
You have completed the following steps:
Process
1. Insert an Element Group.
This element will contain the heading, drawing details and simple sources that we are going to create for this section of the report.
Add an Element Group element to the Report Layout structure. It should be on the same level as the element groups that you created earlier.
Tip
If the element is not inserted to the right location in the element structure, use the Move Up or Move Down buttons in the toolbar to move them to the correct place.
Double-click the element in the structure to edit it.
Enter the name Drawings, which will identify the element in the structure.
Select the Allow Excluding Group from Export checkbox to enable a selection parameter during report generation. This allows users to exclude this element group from the report output when they start generating the report. This feature is particularly useful when you have numerous drawings that take a long time to generate, and you want to quickly review other parts of the report.
Click OK.
2. Insert a level-2 Section Heading for the drawings.
Add a Section Heading element to the Report Layout structure so that it is included within the Drawings element group.
Double-click the element in the structure to edit it.
Enter a name that identifies the element in the structure, for example, Drawings Heading 2. This text does not appear in the actual report output.
Enter the text of the heading that you want to see in the output in the Content field, for example, Drawings.
Select the Include in Table of Contents checkbox to have this section heading appear in the Table of Contents.
In the Default Style field, select Heading 2, which is a preconfigured style that can be applied for level-2 section headings. If required, you can set up your own style and apply that instead (see Styles).
Click OK.
3. Insert a Simple Source for the Drawings.
This simple source will be used as the data source for the Drawing Details element and will refer to the Drawing system table. Since we want to use the name of the drawing as the caption, we add the extra field Name from the Library system table. We also set up an asset tree filter with a user parameter for VN_ID to allow the user to filter based on a specific branch of the asset tree. When generating the report, the user will see a selection dialog where they can select the required asset tree branch.
Add a Simple Source element to the Report Layout structure so that it is included within the Drawings element group. The Simple Source element is located under the SOURCES node within the Template Definition section of the dialog.
Note
You must insert the simple source within the element group, else, you cannot refer to it from the other elements of the element group.
Double-click the Simple Source element in the structure to edit it.
Specify the name Drawing* for the simple source.
In the Table field, click the ellipsis to select the System Table Drawing.
On the Fields tab, add an extra field as follows:
Click Add to add an extra field to the Simple Source.
You can see that a Simple Column entry has been added but with no field selected.
Right-click the row, or choose Input from the toolbar and choose Field…, which brings up a new dialog.
Select the Name field under the Library* system table.
Since the name appears as Library, double-click in the Field / Alias field for the new row and overwrite the name to Drawing Name.
On the Filters tab, create a new filter with the following data:
Field: Click the ellipsis and select the VN_ID field from under the Asset Location system table.
Comparison: Is Child Of*
Parameter: User
Value: VN_ID
Click OK.
4. Insert a Simple Source for Asset.
We want to display layers on the drawings, which will require some asset data, thus, we need to insert a simple source that links to the Asset Location system table. We also need to extend the simple source with additional fields for Asset Name, Asset Component ID and Traffic Light colour. Similarly to the step above, we also set up an asset tree filter with a user parameter for VN_ID to allow the user to filter based on a specific branch of the asset tree.
Add a Simple Source element to the Report Layout structure so that it is included within the Drawings element group.
Note
You must insert the simple source within the element group, else, you cannot refer to it from the other elements of the element group.
Double-click the Simple Source element in the structure to edit it.
Specify the name Asset* for the simple source.
In the Table field, click the ellipsis to select the System Table Asset Location.
On the Fields tab, add extra fields as follows:
Click Add to add an extra field to the Simple Source.
You can see that a Simple Column entry has been added but with no field selected.
Right-click the row, or choose Input from the toolbar and choose Field…, which brings up a new dialog.
Select the Component_ID field under the Asset system table.
Double-click in the Field / Alias field for the new row and overwrite the name to Component ID.
Add two other fields in the same way:
A row for the Name field under the Asset system table, overwrite name to Asset Name.
A row for the Rolled Up (Colour) field from the Traffic Lights system table.
On the Filters tab, create a new filter with the following data:
Field: Click the ellipsis and select the VN_ID field from under the Asset Location system table.
Comparison: Is Child Of*
Parameter: User
Value: VN_ID
Click OK.
5. Insert a Text (Paragraph) element for introduction.
You want to insert an introductory text to the report before the drawings. You want this text to include the Asset Location ID (VN_ID) that the user selects when generating the report, thus, it has to be a variable. To do that, you add a Text (Paragraph) element as shown below:
Add a Text (Paragraph) element to the Report Layout structure so that it is included within the Drawings element group and it comes after the Section Heading element.
Double-click the new element in the structure to edit it.
In the Content field, enter text as follows:
Enter See below the drawings associated with Asset “.
Right-click and choose
to select the user parameter that you have added to the Simple Sources earlier.Continue entering the text: “” and its children:”
That is, the text that you have added looks like this: “See below the drawings associated with Asset “[PARAM VN_ID]” and its children:”
Click OK.
6. Insert the Drawing Details element.
Add a Drawing Details element to the Report Layout structure so that it is included within the Drawings element group and it is under the Text (Paragraph) element.
Double-click the element in the structure to edit it.
In the Edit Drawing Details dialog, enter data as follows:
Name: Enter Drawing Details or any name that identifies the element in the structure.
Source: Select the Drawing source, which you have created earlier.
Caption Field: Select the field Drawing Name, which you have added to the simple source earlier.
Automatically Rotate for Page: Leave it selected.
DPI Scale: Leave the value 1.
View Options: Select Display All Layers. Additional fields become available for selection.
Asset Source: Select the Asset source, which you have created earlier. This will be used to retrieve information for the layers.
Asset Field: Select the field Component_ID, which you have added to the simple source earlier.
Name Field: Select the field Asset Name, which you have added to the simple source earlier.
Colour Field: Select the field Rolled up (Colour), which you have added to the simple source earlier.
Click OK.
report.template.workpack.drawing_details |
Result
When you generate the output, you can see that the drawings have been inserted including the layers The text above the drawings shows the VN_ID that you selected when generating the report.