Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Version 11.5
pdms1151/man8/doc1
issue 140403
PLEASE NOTE:
AVEVA Solutions has a policy of continuing product development: therefore, the
information contained in this document may be subject to change without notice.
AVEVA SOLUTIONS MAKES NO WARRANTY OF ANY KIND WITH REGARD
TO THIS DOCUMENT, INCLUDING BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
While every effort has been made to verify the accuracy of this document,
AVEVA Solutions shall not be liable for errors contained herein or direct,
indirect, special, incidental or consequential damages in connection with the
furnishing, performance or use of this material.
This manual provides documentation relating to products to which you may not
have access or which may not be licensed to you. For further information on
which Products are licensed to you please refer to your licence conditions.
For details of AVEVA's worldwide sales and support offices, see our website at
http://www.aveva.com
1 Introduction to Reports...............................................................................1-1
1.1 The Sample Report Templates ................................................................................1-1
1.2 Before You Start.......................................................................................................1-3
1.3 Starting to Use Reports ...........................................................................................1-3
1.4 How to Use This Manual .........................................................................................1-3
1.5 Running a Report from a Saved Template .............................................................1-4
2 Creating and Running a Simple Report .....................................................2-1
2.1 Creating a Simple Nozzle Schedule ........................................................................2-1
2.1.1 Destination ......................................................................................................2-1
2.1.2 Selection ..........................................................................................................2-1
2.1.3 Columns...........................................................................................................2-2
2.1.4 Running the Report ........................................................................................2-3
2.2 Column Layout.........................................................................................................2-3
2.3 Adding and Moving Columns ..................................................................................2-4
2.4 Runtime Prompts .....................................................................................................2-4
2.5 Saving and Deleting Templates ..............................................................................2-6
2.5.1 Saving a Template ..........................................................................................2-6
2.5.2 Deleting a Template .......................................................................................2-6
2.6 Reporting on Different Parts of the Database ........................................................2-6
2.6.1 Adding Elements using the Members List ....................................................2-7
2.6.2 Adding Elements in a Given Volume.............................................................2-7
2.6.3 From ................................................................................................................2-8
2.7 More Column Layout Options .................................................................................2-8
2.7.1 Layout..............................................................................................................2-8
2.7.2 Numeric Display ...........................................................................................2-10
2.7.3 Text Display ..................................................................................................2-10
2.8 Introductions and Summaries...............................................................................2-11
3 Sorting and Totalling...................................................................................3-1
3.1 Changing the Order of Sorting ................................................................................3-2
3.2 Sorting on More than one Attribute........................................................................3-3
3.3 Totalling ...................................................................................................................3-5
3.4 Subtotalling ..............................................................................................................3-6
3.4.1 Showing only the First Occurrence of Values ...............................................3-7
3.5 Quantity....................................................................................................................3-9
4 Selective Reporting .....................................................................................4-1
4.1 Introduction to Expressions ....................................................................................4-1
4.1.1 Format of Expressions ....................................................................................4-2
4.1.2 Operator Precedence.......................................................................................4-3
4.2 Using Positions in Expressions ...............................................................................4-3
4.2.1 WRT .................................................................................................................4-4
Most of the examples are based on the sample project and the sample
templates supplied with the product.
The sample templates produce the following types of report:
nozz_sched This is a Nozzle schedule, which lists all Nozzles
sorted by name, and shows the P1 bore,
connection type and direction, and the position of
each Nozzle.
line_list This report is a list of Branches, sorted by the
name of the Pipe which owns them. The Head
and Tail bores and the Head and Tail references
are given.
pipe_mto This report shows material information for all
Branch members, sorted by type, Detail Text an
Material Text. The Tube length and quantity of
each component are totalled. There is an Imperial
version of this report template.
tube_mto This report totals all Tubing. The Specification
Reference, P1 Bore, Detail Text and Material
Text are shown.
steel_mto This is a material take-off list for structural
components.
valve_list This report is an example of selective reporting.
centre_line The centre-line length of each Branch is listed.
There is an Imperial version of this report
template.
tube_gradient This report gives the gradient of each tubing
component.
catalogue_param This is an example of reporting on the catalogue
database. It lists Branch members, with their
CATREFs and the parameters of the CATREFs.
catalogue_ptgmref This is an example of reporting on the catalogue
database. It lists Branch members, with their
CATREFs followed by the PTREFs and GMREFs
of the CATREFs.
tube_area_vol This report uses derived properties to report on
the area and volume of tubing.
This manual assumes that you are familiar with PDMS to the level of the
Basic Training Course.
Most of the examples in this manual illustrate templates which report
directly on PDMS attributes and pseudo-attributes. You can also use
more complex expressions in report templates, and although some of
these are illustrated, you will need to be familiar with PML, the
Cadcentre Programmable Macro Language, if you want to set these up
for yourself.
For information about further training, please contact your nearest
Cadcentre Support Office (see the copyright page at the front of this
guide for details).
To use the sample templates supplied with the product, the PDMS
variable $PDMSREPDIR should be set to the directory where the sample
reports are stored.
You will usually have a library of report templates set up for you, but you
can produce and run a report template quickly by selecting
Reports>Create, filling in the New Report Template form to specify what
you want to report on and then pressing Apply on the form, which will
run the report.
Note that this is the easiest way of testing a template that you are
creating or modifying.
This chapter describes how to create a simple report template, run it and
save it. To work through the example, start up DESIGN, DRAFT or
PARAGON, using the SAM project.
2.1.1 Destination
Destination allows you to specify whether the report is output to Screen.
or to a File.
2.1.2 Selection
The Selection options allow you to specify the type of item you want to
report on, and the level in the database hierarchy below which the
selection will be made.
The Zone EQUIP in the sample project contains the Equipment /E1301,
which owns several Nozzles. We will produce a template to report on
these Nozzles.
2.1.3 Columns
Now create three columns for the report, to display the name of the
Nozzle, the arrive bore and the position, using the Columns options.
1. Select the New option button, and the Creating Column form will be
displayed.
The Expression text box defines the contents of the column. You can
enter a PDMS attribute or pseudo-attribute here, or an expression
containing attributes or pseudo-attributes.
Ignore the Sorting and Precedence option for now. By default, the list of
items in the report will be sorted in the order in which they are stored in
the database.
You can set the Units option when appropriate.
The Column Layout button is used to control the format of each column,
but we will use the default layout for now.
Note that by default the text that you entered in the Expression text box
is used as the column heading. You can change this, as described in
Section 2.7.3, Text Display.
The layout of this report is not very easy to read, so now we will use the
option on the Layout for Column form to improve it.
Highlight POS in the list on the New Report Template form, and select
Modify. On the Modifying Column 3 form, select Column Layout, and you
will see the Layout for Column form.
Set the Spaces before Column option to 4, and set Justification to Left.
The output will look like this:
Further column layout options are describes in Section 2.7, More Column
Layout Options.
Now we will add two more columns to the report, for P1 CONN and P1
DIR.
1. A new column is inserted before the one selected in the list on the
New Report Template form. To insert a column at the end of the list
of columns, make sure that the entry reading <end> is highlighted,
and select New again.
2. Enter P1 CONN into the Expression text box and set Units to Off.
On the Column Layout form, set justification to Left. Select Next
Column on the Creating Column form.
3. Enter P1 DIR into the Expression text box and set Units to Off. On
the Column Layout form, set justification to Centre and select OK.
4. Select OK on the Creating Column form.
Remember that inserting a new column will renumber all columns to the
right of the new column.
Now move the POS column so that it is the last (fifth) column again.
1. Highlight the POS column in the list on the New Report Template
form, and select the Move option button. You will see the Move
Column form. Select 5 from the option gadget and select OK.
2. Select Apply on the New Report Template form. The modified report
should look like this:
If you are going to save the template so that it can be run in future, it is
likely that you will want to have some control over the content when the
report is run. For example, you will want to specify the part of the
hierarchy to report on.
You can control what information the user is prompted for when the
report is run using runtime prompts. The Runtime Prompts form will be
displayed when you select Options>Runtime Prompts on the menu on
the New/Modify Report Template form.
The options correspond to the options on the New/Modify Report Template
form. They are:
File name
Type(s)
With
Hierarchy
Volume
From
File name allows you to specify the file where the report will be stored.
The only other options we have looked at so far are Type(s) and
Hierarchy.
Note 1: If you specify in the template that a report will be sent to a file,
and the user removes the filename on the Report Details form, the
report will be sent to the screen. However, if you specify that the
report will be sent to the screen, do not switch on the Filename
option on the Runtime Prompts form, because the report will be
sent to the screen even if the user gives a filename.
Note 2: Do not set any runtime prompts for report templates intended for
batch mode.
Note 3: Text boxes filled on the Runtime Prompts form will appear as
defaults on the Report Details form.
The parts of the database you want to include in the report are specified
by entering the elements at the top of each part of the hierarchy in the
Hierarchy text box on the New/Modify Report Template form. The default
is the World. If you just want to specify one or two elements, you can just
type in the element names. The names must always be preceded by a
slash and separated by a space, because you can enter several names, for
example:
/100-B-1 /100-B-2
If you want to specify several elements, it is easiest to use the Hierarchy
form, which also allows you to report on all the elements in a Volume,
selected from the MDB, the Drawlist or the Obstruction list.
2.6.3 From
The From options are used to specify where the Reports Utility will look
for the elements to report on:
MDB should be used if you are giving specific elements in the
Hierarchy.
Drawlist will select all elements in the drawlist. The Hierarchy text
box should be left blank.
Obstruction list will select all elements in the obstruction list. The
Hierarchy text box should be left blank.
The following examples illustrate some more of the options on the Layout
for Column n form.
Some of the options are only used in sorting and totalling, and these are
described in Chapter 3, Sorting and Totalling. Some only apply to File
reports, and these are described in Chapter 5, File Reports. This section
describes the general options which apply to all reports.
2.7.1 Layout
The number of Spaces before column. This is the number of spaces
between the end of the previous column and the start of the current
column. The effect will be affected by the Justification.
The Column width in characters. If you do not give a value, the width of
the widest entry will be used.
The Justification can be set to Left, Centre or Right.
The effects of the layout options are illustrated in the following examples,
based on the template centre_line.tmp:
The format as supplied:
Space before the HBORE column set to 2, and the column width set to
15:
Totals can only be produced for columns containing numeric data, and
which do not have the Subtotal option set. For more information, see
Chapter 3, Sorting and Totalling.
The Page options on the menu on the New/Modify Report Template form
can be used to insert Introductions and Summaries into screen or file
reports. However, they normally involve using variables, which are
introduced in Chapter 4, Selective Reporting, and so they are described
later, in Chapter 5, File Reports.
By default, the items reported on will be listed in the order that they are
stored in the database.
You can specify which attributes will be used to sort the elements in the
report and the type of sorting, for example, ascending or descending
numerical order. If more than one attribute is used for sorting, you can
control the precedence, that is which attribute is sorted first.
For this exercise, look at the template line_list.tmp by selecting
Utilities>Reports>Modify on the Main Menu.
Note: The sample templates are all for file reports, with runtime
prompts set. If you want to try the examples, send the reports
to the screen and switch the prompts off (use Options>Runtime
Prompts on the New/Modify Report Template form).
This template reports on the Pipe Name, Specification, Head Bore, Tail
Bore, Head Ref and Tail Ref of Branches. The template sorts the
Branches in ascending order of Head Bore.
With the Hierarchy set to the Zone PIPES, the output will look like this:
Remember to use the Next column and Previous column option buttons
on the Modify Columns form, to move between columns.
Keeping Sorting as 0-9 for HBORE, switch Sorting to 0-9 for TBORE.
Note that the Precedence button is now set to 2, and that the precedence
is also shown by Sort 1 and Sort 2 against the columns on the Modify
Report Template form. Go back to the HBORE column, and note that the
Precedence is shown as 1. This means that the Branches will be sorted
first in order of Head Bore, and second in order of Tail Bore.
If you run the report now, the output will look like this; note the different
order for Branches with HBORE 50:
3.3 Totalling
To see the effect of totalling, use the template centre_line.tmp and set
the hierarchy to 100-B-1 and 100-B-2.
The template as supplied will report on the Branches, giving the Pipe
name and the Pipe Specification, sorted on descending order of Head
Bore, and the Centre Line Length, as follows:
Now switch on the Totalling option button on the Layout for Column form
for the Centre Line Length column, and the report will appear like this:
3.4 Subtotalling
The Subtotals option on the Layout for Column form can be Off or set to
the number of a sorted column. Subtotals can only be produced for
columns containing numeric data.
Set Subtotalling on for the Centre Line Length column, and the report
will look like this:
===========
55236.56
===========
55236.56
You can display each value for a sorted column next to the corresponding
subtotal value.
Set the Values option for HBORE (which must be sorted) to Sub. Set the
Centre Line Length Subtotals to 4, that is, show subtotals for each value
in column 4 (HBORE).
===========
55236.56
3.5 Quantity
The With option on the New/Modify Report Template form allows you to
restrict the report to elements of the given type whose properties satisfy
given conditions. The restriction is defined by an Expression, which is
entered in the text box.
Full information about using expressions is given in the online help. If
you understand the basic principles of using expressions, refer to PDMS
Expressions: Contents or search for the keyword you want.
A summary of the information you are most likely to need in selective
reporting is given below.
The expressions used in selective reporting will be a combination of
PDMS attributes or pseudo-attributes, logical operators and values.
For example, if you are reporting on Elbows (that is, you have entered
ELBO in the Type text box), you can restrict the report to Elbows with
ABORE greater than 50 by entering the expression:
ABORE GT 50
where ABORE is the PDMS attribute, GT is an operator meaning
greater than, and 50 is the value. The operators you can use are:
EQ equal to
NE not equal to
GT greater than
GE greater than or equal to
LE less than
LT less than or equal to
You can specify more than one condition using the operators AND, OR
and NOT. For example, to report on Elbows with ABORE greater than 50
but less than 100 enter:
(ABORE GT 50) AND (ABORE LT 100)
4.2.1 WRT
The 'WRT' keyword is used to toggle between absolute and relative
units.
When we specify an element (or attribute of an element) we are
specifying an absolute point in world space. The point can be given in
world space or some other axis. Normally the answer is required relative
to the owner axis system and this is taken as the default. For example:
Q POS
will return the position of the current element relatively to its owner.
Q POS OF /EQUIP1
will return the position of EQUIP1 relative to its owner. If we require
the result in some other axis system then the WRT keyword is used. e.g.
Q POS WRT /* for the position in world coordinates.
When we specify a Cartesian coordinate we are dealing with a relative
position. For example, 'N 10' is meaningless until we specify the axis
system, or default to an axis system. Again we use 'WRT' to do this,
although it is important to note that in this case we are going from a
relative position to an absolute position (in the previous example WRT
was used to go from an absolute position to a relative one). For example:
N 100 WRT /BOX1
specifies an absolute position in world space which is N100 of /BOX1.
The default is that Cartesian coordinates are in the owning element's
axis system. This absolute position can be expressed in different
coordinate systems: the default is again the owner's axis system.
Note: The CONSTRUCT syntax uses the world as the default axis.
Example 1
Consider the following:
A SITE at (0,0,0) with default orientation
A ZONE at (100,0,0) with default orientation
An EQUIPMENT at (100,0,0) with orientation 'N IS E'
A BOX at (-100,0,0) with default orientation
The result of 'Q (N 100 WRT /BOX1)', shown as * in the picture, will
depend on the current element:
• At the World, the result is (300,100,0), in World coordinates.
• At the Site, the result is (300,100,0) in World coordinates because the
World is the owner of the current element.
• At the Zone the result is (300,100,0) in World coordinates, because the
Site is the owner of the current element, and the Site coordinates are
the same as the World coordinates.
• At the Equipment the result is (200,100,0), which is the position
relative to its owner, the Zone.
• At the Box the result is (100,100,0) which is the position relative to its
owner, the Equipment.
WRT can be further qualified by FROM.
4.2.2 FROM
In some cases we require an offset from a fixed point, other than the
position of an item. e.g. ppoint or attribute. The FROM syntax is used for
this. We may still use WRT in combination with FROM, but in this case
the WRT is only used to determine the axis direction and not the offset,
since the offset is specified by the FROM part.
Consider the following:
A SITE at (0,0,0) with default orientation
A ZONE at (100,0,0) with default orientation
An EQUIPMENT at (100,0,0) with orientation 'N IS E'
A BOX at (-100,0,0) with default orientation
Example 2
The result of 'Q (N 100 WRT /* FROM /BOX1 )', shown as * in the
following picture, will depend on the current element:
• At World, Site, Zone the result is (200,200,0) since the offset of N100
is applied in world axis rather than /BOX1 axis.
• At the equipment the result is (100,200,0). Note: the default axis for
the result is the zone.
• At /BOX1 the result is (200,0,0), because the default axis for the
result is the equipment.
Example 3
'Q (N 100 WRT /BOX1 FROM /* ) gives the same absolute position as the
ZONE.
• At the Zone and SITE the result is (100,0,0)
• At EQUI the result is (0,0,0)
• At BOX1 the result is (0,-100,0), remembering that the result axis is
the EQUI.
Example 4
'Q (N 100 FROM /* )'
For this we cannot mark an absolute point on the diagram since the
default 'WRT' will vary with the current element. In fact for the SITE,
ZONE, EQUI the point * is marked in the following picture, and for the
BOX the point coincides with the ZONE.
Note: Some of the ID syntax clashes with other types. To allow for this,
an id expression may always be preceded with the keyword ID.
For example, ID 3 will mean the third member of the current list
rather than a real of value 3.
ID arrays can also be used in expressions. For example, CRFA.
4.4 Direction
4.5 Orientations
This chapter describes how to set up templates for reports that will be
output to a file. The content of the reports is defined in the same way as
for screen reports, and the layout of the columns is also controlled in the
same way, but there are additional options which control headers, footers
and headings and other information which can be added to file reports.
Set Destination to File, and give a filename in the text box. The file will
be stored in the directory PDMSUSER/REPORTS.
You should also specify what will happen if the file exists. The options
are
Append. If the file exists, output will be appended to it.
New. If the file exists, you will be prompted to confirm that you
want to overwrite the file.
Overwrite. If the file exists, it will be overwritten with no warning.
The options under Page Information on the menu at the top of the
New/Modify Report Template form allow you to add information which is
not specified in the body of the report. The options are:
Set a Header
Set a Footer
Insert an Introduction into the Report
Insert a Summary into the Report
Set the Page Length
Each option displays a form with a text pane. You type the information
you want in the text pane. Each line of information is entered as an
expression.
Full information about using expressions is given in the online help.
Refer to the topic PDMS Expressions: Contents or search for the keyword
you want.
Both file reports and screen reports can have an Introduction and
Summary. You can insert whatever text and variables you want.
5.5 Examples
The following examples are mainly taken from the templates supplied
with the product.
To insert a page number containing the text Page number, followed by
the page number, use the !pageno variable:
'Page No. ' + vtext (!pageno)
To insert the user’s name in the form of the text User Name: followed
by the name, use the PDMS global variable !!user:
'User name: ' + vtext(!!user)
To insert the date and time, use the report variables !date and !time:
'Date: ' + vtext(!date) + ' ' + vtext(!time)
Report templates are PDMS macros, which can be run in batch mode by
giving the command $M/template-name. For more information about
batch mode, see the PDMS MONITOR Reference Manual.
Note: Report templates for batch mode must not have any runtime
prompts set.
The System Command text box on the New/Modify Report Template form
allows you to give a system command that will be run when the report
has been completed.
For example, you could use this option to send the report output to a
printer, or to run a macro to process the report. The command is entered
as an expression. For full information about expressions, see
Introduction to Expressions, but an example of how to enter a system
command is given below.
The Report Format form will be displayed when you select Options >
Other Formats on the menu on the New/Modify Report Template form. It
allows you to output a report in CSV (Comma Separated Variable)
format, which can be read into a spreadsheet.
You can specify the field separator and text delimiter. Values in the
report are recognised as text if the Units option on the Creating Column
form is set to Off.
Index
Expressions, 4-1
direction in, 4-10 Justification, 2-10
format, 4-3
IDs in, 4-9
Templates
deleting, 2-7
Page information, 5-1
saving, 2-6
Page length, 5-1, 5-4
Text Display, 2-11
Positions in expressions, 4-4
Totalling, 3-1, 3-5
Precedence, 3-3
Totals, 2-12
Unset text, 2-11
Quantity, 3-9
Values, 2-12
in subtotalling, 3-7
Remainder, 2-11
Variables
Report Details form, 1-4
late evaluation, 5-3
Report variables, 5-2
Volumes
Reports directory, 1-1
adding elements from, 2-9
Running a report, 1-4
Runtime prompts, 2-5
Runtime Prompts, 3-1
With option, 4-1