Accessing a Report's Object Properties

You can create your own custom report and label templates. PC-DMIS uses them to display report data inside a Report window (see View | Report Window). You use template editors to create the templates. The editors utilize a Visual Basic-like interface that you can use to insert, relocate, and size special components called "objects".

Each object consists of "properties" that define how it appears and what information it holds. Some of these properties are common to all other objects, some are common to only related objects, and others are unique to that specific object.

The PC-DMIS Expression Language can query the currently loaded report and store property values of a particular object in a variable. It can obtain values of type String, Integer, and Real by using this syntax:

Property Query Syntax

ASSIGN/V1=Report.<Object Name>.<Property Name>

Report is a reference to the currently loaded report. <Object Name> is the object's unique name. <Property Name> is a valid property name for that object.

Example

Suppose that your report template has a text object called "Text1" that you want to use in the final report to display the operator's name. PC-DMIS stores the actual string of characters that represent the operator's name in the Text property of the object. By default, the text property (displayed text) initially has the value of "Text1" (see the figure below). Because this is a user-assigned property, the property's value changes when you type in the name during execution.

Properties dialog box that shows a selected object and the property to query

To use the Expression Language code to query this Text object's "Text" property and obtain the keyed-in data, you would use the following command:

ASSIGN/V1=Report.Text1.Text

In this code:

"Report" tells the code to look at the report loaded in the Report window.

"Text1" tells it to look for the object named "Text1".

"Text" tells it to look for the "Text" property within that object. The value of the "Text" property then gets passed into the V1 variable, which you could then further manipulate or display using the PC-DMIS Expression Language.

Finding Properties

To find the properties that are associated with a particular object, access the Report template in the Report template editor (File | Reporting | Edit | Report Template), select the object, and then right-click on the object to display its property sheet.

Property sheet for a Text object

The property sheet contains two columns. The left column displays the property name. The right column displays the current value. Be sure to use the exact property name in your expression code.

When you query property values, you may find that some properties return a seemingly useless numerical value. Generally, this happens when the property has a set list of available options. PC-DMIS returns an internal value for the selected property that does not relate to the displayed property.

For example, the Text object has an Orientation property with these values:

However, if you obtain the value using PC-DMIS expression language, the software will instead return the following:

It may require some trial and error to determine what returned values correspond with the value displayed on the property sheet.

Related Topics:

About Object Properties

The Object Bar