• No results found

Creating a Report Template – A Worked Example

In document TM-1003 Design Utilities (Page 40-46)

Exercise 2 – Quick Reports

4.1 Creating a New Report Template

4.1.5 Creating a Report Template – A Worked Example

This worked example creates a simple report of quantities of piping components in the AVEVA Plant Stabilizer training project.

4.1.5.1 Creating the Report

Select Utilities>Reports>Create… from the main menu to display the New Report Template form Leave the Destination set to Screen.

Enter BRAN MEMBERS in the Type(s) textbox and press the Return key.

L

MEMBERS is a key word in reporting. It means that the members of the preceding element will be reported, not the element type.

Click the Hierarchy… button on the New Report Template form to display the Hierarchy form.

Select WORLD from the list and click the Remove button to empty the list.

Click the OK button to set an empty hierarchy list and dismiss the form.

On the New Report Template form enter CE in the Hierarchy textbox and press the Return key.

In the Column section of the New Report Template form, select the

<end> entry to highlight it and click the New… button at the bottom of the form to display the Creating Column form.

Enter TYPE in the Expression textbox.

This will display the Type attribute of the elements.

Select A to Z (Ignore Case) from the Sorting options list. This will sort this column in ascending alphanumeric order, ignoring the case of the text.

Note that a 1 is displayed in the

Precedence options list. This means that the report will be sorted on this column first.

Click the OK button on the Creating Column form.

The TYPE column is displayed in the list at the bottom of the New Report Template form:

Select the <end> entry in the list again and click the New… button to display the Creating Column form again.

Enter DTXR in the Expression textbox and select A to Z (Ignore Case) from the Sorting options list. The Precedence options list will be set to 2 automatically.

Click the OK button on the Creating Column form and note that the new column is added to the list on the New Report Template form.

Repeat the procedure to create three more columns, entering MTXX , ITLE and QUANTITY respectively in the Expression textbox.

None of the new columns needs to be sorted.

The New Report Template form should now look like this.

Note that the sort precedence is shown in the list after the expression.

L

The expressions used are:

ƒ

DTXR is a pseudo attribute for the S text of an STDE element.

ƒ

MTXX is a pseudo attribute for the X Text of an SMTE element.

ƒ

ITLE is a pseudo attribute for the implied tube centreline length

ƒ

QUANTITY is a keyword and is usually used in conjunction with subtotalling and totalling.

4.1.5.2 Running the Report

Close the Command Window, if open. Navigate to the Zone /PIPES in the Site /STABILIZER. Make the Pipe /150-A-3 the CE.

Click the Apply button on the New Report Template form.

An AVEVA PDMS Design Command Output form opens and displays the report.

L

The columns are not aligned because the form uses a kerned font.

In the Destination area of the form click the New radio button and enter C:\temp\Branch_Members.txt in the Filename textbox.

Click the Apply button on the New Report Template form again. This time the report is sent to the specified filename and not to the screen. Locate the file in Windows Explorer and open it with a suitable editor. The report should look like this:

www.aveva.com L

Note that the ITLE attribute is only applied to the TUBI (tubing). This is an example of using attributes

that do not occur on every element type that the report may contain.

4.1.5.3 Adding Additional Columns

The report does not show the nominal bore of the piping components. As reducing components will have a different arrive and leave bore two additional columns are required to show these values. The columns will be sorted numerically and will be the highest precedence.

On the New Template Report form, select the MTXX entry in the column list. The new columns will be placed before this attribute.

Click the New… button to display the Creating Column form. Enter ABOR in the Expression textbox and select 0 to 9 in the Sorting options list. Select Any/mm from the Units options list.

Click the OK button on the Creating Column form.

With MTXX selected in the list, repeat the procedure using an expression of LBOR, a 0 to 9 sort and Any/mm units.

4.1.5.4 Modifying the Sort Precedence

Select the ABOR column form the list and click the Modify… button to display the Modifying Column 3 form.

Open the Precedence options list, select 1 and click the OK button on the Modifying Column 3 form. The precedence of the ABOR column is now 1.

Repeat for the LBOR column, setting the precedence to 2.

Select the Screen radio button from the Destination area and click the Apply button on the New Report Template form to re-run the report. Note the change in the report format due to the change in sort precedence.

Sorting the report on type and detail text and then arrive and leave bore makes the report easier to read.

Therefore, change the precedence of the TYPE and DTXR columns to 1 and 2 respectively thereby setting ABOR and LBOR to 3 and 4 respectively.

4.1.5.5 Formatting the Columns

Having created the columns and specified the sorting precedence, the columns may be formatted so that the desired appearance of the report is achieved. This may include changing the spaces between columns, fixing the column width, specifying the number of decimal places or fraction denominator and specifying custom column headings.

Column 1

Select the TYPE column in the New Report Template form list and click the Modify… button to display the Modifying Column 1 form.

Click the Column Layout… button on the Modifying Column 1 form to display the Layout for Column 1 form.

Enter 0 in the Spaces before column textbox. This is the first column and no spaces are required.

Leave the Column Width textbox blank so that the column width is variable and the leave the Justify options list set to L.

As this is an alphanumeric column the Numeric Display area may be ignored for this column.

In the Text Display area of the form, make sure the Headings options list is set to On and click the Custom radio button.

In the Custom text textbox enter COMPONENT, press the Return key and ‘underline’ the text using a row of equal (=) symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 1 from to modify the settings and dismiss the form.

Column 2

On the Modifying Column 1 form, click the Next Column button. This makes column 2 the current column and changes the form name to Modifying Column 2 and modifies the content of the form to display the DXTR column details.

Click the Column Layout… button to display the Layout for Column 2 form and make the following settings:

In the Layout area of the form leave the Space before column, Column Width and Justify settings at the default values.

In the Text Display area of the form ensure Headings are set to On, click the Custom radio button, enter DESCRIPTION in the Custom text textbox and underline with = symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 2 from to modify the settings and dismiss the form.

www.aveva.com

Column 3

On the Modifying Column 2 form, click the Next Column button. This makes column 3 the current column and changes the form name to Modifying Column 3 and modifies the content of the form to display the ABOR column details.

Click the Column Layout… button to display the Layout for Column 3 form and make the following settings:

In the Layout area of the form leave the Space before column, Column Width and Justify settings at the default values. Note that the Justify default is R as this is a numeric column which is normally right justified.

In the Numeric Display area of the form make sure the Decimal radio button is selected and enter 0 in the Decimal Places textbox.

In the Text Display area of the form ensure Headings are set to On, click the Custom radio button, enter ARRIVE BORE (mm) in the Custom text textbox and underline with = symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 3 from to modify the settings and dismiss the form.

Column 4

Use the same settings as Column 3 but change the Custom text to LEAVE BORE (mm).

Click the OK button on the Layout for Column 4 from to modify the settings and dismiss the form.

Column 5

On the Layout for Column 5 form, leave the Layout area options at their defaults.

In the Text Display area of the form ensure Headings are set to On, click the Custom radio button, enter MATERIAL in the Custom text textbox and underline with = symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 5 from to modify the settings and dismiss the form.

Column 6

On the Layout for Column 6 form, leave the Layout area options at their defaults.

In the Numeric Display area of the form make sure the Decimal radio button is selected and enter 0 in the Decimal Places textbox.

In the Text Display area of the form ensure Headings are set to On, click the Custom radio button, enter LENGTH (mm) in the Custom text textbox and underline with = symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 6 from to modify the settings and dismiss the form.

Column 7

On the Layout for Column 7 form, leave the Layout area options at their defaults.

In the Numeric Display area of the form make sure the Decimal radio button is selected and enter 0 in the Decimal Places textbox.

In the Text Display area of the form ensure Headings are set to On, click the Custom radio button, enter NO. OFF in the Custom text textbox and underline with = symbols.

Make sure the Values options list is set to On and the Subtotals and Total options lists are set to Off.

Click the OK button on the Layout for Column 7 from to modify the settings and dismiss the form.

Click the OK button on the Modifying Column 7 form to save the settings for all columns and dismiss the form.

Make sure the Screen radio button is checked in the Destination area of the New Report Template form, and click the Apply button to display the report on the screen. Check the headings and other formatting have been applied.

4.1.5.6 Filtering the Output

Make Branch /100-B-8-B1 the CE and click the Apply button on the New Report Template form again.

Note in the report output for this branch that ATTA and WELD members are included and that some of the columns do not have values assigned.

For the purposes of this report the ATTA and WELD types of branch members will be excluded. The types of members being reported on must, therefore, be filtered to exclude these types.

Enter TYPE NE 'ATTA' AND TYPE NE 'WELD' in the With textbox. Re-run the report to ensure that the element types have been omitted.

4.1.5.7 Applying a System Command

Click the New radio button in the Destination area of the form and make sure the Filename is set to C:\temp\Branch_Members.txt.

Enter ‘NOTEPAD C:\temp\Branch_Members.txt’ in the System Command textbox.

Click the Apply button on the New Report Template form.

Click the Yes button on the Confirmation message to overwrite the existing file.

The report will run and Notepad will open, displaying the report.

4.1.5.8 Saving the Template

On the New Report Template form menu select File>Save As… to display the Save Report As… file browser.

Browse to the C:\temp folder, enter Branch_Members.tmp in the File name textbox and click the Open button to save the report to the specified file name.

www.aveva.com

In document TM-1003 Design Utilities (Page 40-46)

Related documents