• No results found

Modifying a Report – A Worked Example

In document TM-1003 Design Utilities (Page 50-54)

Exercise 2 – Quick Reports

4.2 Modifying a Report Template

4.2.5 Modifying a Report – A Worked Example

This worked example modifies the report template created earlier to add subtotals and totals, a runtime prompt, a header and footer. A csv version of the report will be created.

4.2.5.1 Setting-up Subtotals and Totals

If the report template has been closed, select Utilities>Reports>Modify… from the main menu to display the Modify Report… file browser form. Locate the previously saved template and click it to open the Modify Report Template <path> <filename> form.

Subtotals for quantity and implied tube length are required whenever the component type, detailed text, arrive and leave bores and material changes. Therefore, a ‘hidden’ column is required that concatenates the columns values such that subtotals are given when the content of any of the columns changes.

Totals are required for component quantity and implied tube length.

Click the <end> entry in the columns list on the Modify Report Template form. Click the New… button to display the Creating Column form.

Enter TYPE + DTXR + STRING(ABOR) + STRING(LBOR) + MTXX in the Expression column, select A to Z (Ignore Case) from the Sorting options list and click the Column Layout… button to display the Layout for Column 8 form.

Select Off from the Headings options list.

As this is a hidden column no headings are required.

Select Off from the Values options list so that the contents of the column are not shown in the report.

Click the OK button on the Layout for Column 8 form and then click the OK button on the Creating Column form.

The Modify Report Template form should now look like this.

As the report will be using column 8 for subtotalling, all of the other columns must be modified to only show a value when a subtotal is displayed. Columns 6 and 7, i.e. the subtotalled columns, require the subtotals to be set for column 8 changes. Columns 1 to 4 inclusive do not need to be sorted as the sorting is done by column 8.

Select Column 1 in the columns list and click the Modify… button to display the Modifying Column 1 form.

Select Off in the Sorting options list and click the Column Layout… button to display the Layout for Column 1 form.

Select Sub from the Values options list and click OK on the Layout for Column 1 form.

Click the Next Column button on the Modifying Column 1 form to display the Modifying Column 2 form.

Select Off in the Sorting options list and click the Column Layout… button to display the Layout for Column 2 form.

Select Sub from the Values options list and click OK on the Layout for Column 2 form.

Click the Next Column button on the Modifying Column 2 form to display the Modifying Column 3 form.

Select Off in the Sorting options list and click the Column Layout… button to display the Layout for Column 3 form.

Select Sub from the Values options list and click OK on the Layout for Column 3 form.

Click the Next Column button on the Modifying Column 3 form to display the Modifying Column 4 form.

Select Off in the Sorting options list and click the Column Layout… button to display the Layout for Column 4 form.

Select Sub from the Values options list and click OK on the Layout for Column 4 form.

Click the Next Column button on the Modifying Column 4 form to display the Modifying Column 5 form.

Click the Column Layout… button to display the Layout for Column 5 form.

Select Sub from the Values options list and click OK on the Layout for Column 5 form.

Click the Next Column button on the Modifying Column 5 form to display the Modifying Column 6 form.

Click the Column Layout… button to display the Layout for Column 6 form.

Select Sub from the Values options list and select 8 from the Subtotals options list. This will create the subtotal when column 8 changes value.

Select On from the Totals options list. This will create a total for the implied tube of all sizes..

Click OK on the Layout for Column 6 form.

Click the Next Column button on the Modifying Column 6 form to display the Modifying Column 7 form.

Click the Column Layout… button to display the Layout for Column 7 form.

Select Sub from the Values options list and select 8 from the Subtotals options list. This will create the subtotal when column 8 changes value.

Select On from the Totals options list. This will create a total for all the components.

Click OK on the Layout for Column 7 form.

Click the OK button on the Modifying Column 7 form to save the changes.

Make pipe /100-B-1 the CE. Make sure the report destination is set to a new file and that the filename is entered in the textbox.

Click the Apply button on the Modify Report Template form.

Click the Yes button on the overwrite confirmation message. The report will be displayed by Notepad:

www.aveva.com

4.2.5.2 Saving the Modifications

Select File>Save from the Modify Report Template form menu to display an overwrite confirmation message.

Click the Yes button to save the template to the same filename.

4.2.5.3 Adding a Header and Footer

Select Page Info>Header… from the Modify Report Template form menu to display the Header form. Add the following text:

'Filename ' + vtext(!filename) ' '

Select the OK button on the Header form to set the header information and dismiss the form.

Select Page Info>Footer… from the Modify Report Template form menu to display the Footer form. Add the following text:

'Page ' + vtext(!pageno) ' '

'Date: ' + vtext(!date) + ' ' + vtext(!time)

' '

Select the OK button on the Footer form to set the footer information and dismiss the form.

4.2.5.4 Adding a Runtime Prompt

Select Options>Runtime Prompts… from the Modify Report Template form menu to display the Runtime Prompts form.

Check the Filename checkbox on the form and click the OK button.

Remove the text from the System Command textbox.

Make the Zone /PIPES the CE and test the changes by clicking the Apply button on the Modify Report Template form. Select a new filename when prompted and open the file, when completed, to check the formatting and contents.

4.2.5.5 Creating a CSV Report

Select Options>Other Formats… from the Modify Report Template form menu to display the Report Format form.

Select CSV from the Format options list and remove the default text delimiter (“) from the Text Delimiter textbox so that it is blank.

Click the OK button on the Report Format form.

Change the filename in the Destination area of the Modify Report Template form from C:\temp\Branch_Members.txt to C:\temp\Branch_Members.csv.

Select Page Info>Page Length… from the Modify Report Template form menu to display the Page Length form. Empty the Page Length textbox so that headers and footers are not added to the csv file.

Click the OK button on the Page Length form.

Click the Apply button on the Modify Report Template form and enter a suitable filename (.csv extension) when prompted.

Locate the file with Windows Explorer and double click it to open it in Excel and check the report.

www.aveva.com

In document TM-1003 Design Utilities (Page 50-54)

Related documents