From the Object Properties window you can access the Attach to Function Data dialog, which is used to connect an object property to a function. A function enables you to perform calculations on data before it is attached to object in RTView displays. See “Add/Edit Functions” for details on creating functions. The file functions.rtv (located in the tutorials directory) is provided as an example of the different ways that functions can be utilized in a display.
When an object property is attached to data, the Property Name and Value in the Object Properties window will be displayed in green. This indicates that editing this value from the Object Properties window is no longer possible. To remove the data attachment, and resume editing capabilities in the Object Properties window, right-click on the Property Name and select Detach from Data. You will recognize that an object property has been detached from the data source when the Property Name and Value are no longer green.
To bring up the Attach to Function Data dialog, right-click on the Property Name from the Object Properties window and select Attach to Data>Function.
Field Name |
Description |
Function Name |
List of all available local, global, and include file functions. See “Global Functions and Variables” and “Include Display Files” for more information. |
Column(s) |
If your function contains tabular data you can select which column(s) to display. |
Filter |
Check box to indicate whether or not to filter this function. Filters can only be used for functions that return tabular data. |
Filter Column |
Name of the table column to use as a filter. |
Filter Value |
Value that the filter column must equal. Enter * to display all rows in the table. Enter "*" to use * as a literal comparative value. To list multiple values, separate with a semicolon. For example: value1;value2;value3. If your value contains a semicolon, enclose it in single quotes. |
Description |
Displays the description of this function. This description can be edited from the “Functions” window. |
The Function Name drop down menu lists all available functions. If you have not defined any functions this list will be empty. Select Tools>“Functions” to create a function. It is possible to type in a function name that has not yet been defined, but it will not be valid until you create a function by that name.
Note: Functions are only available for use within the display where they are created. The Filter Column and Filter Value fields are only applicable if the attached function returns tabular data.
Fields in the dialog change colors according to the information entered. These colors indicate whether or not information is valid. Information entered into the dialog is validated against the list of functions you created for this display. The following describes the significance of the Attach to Function Data validation colors:
Blue |
Unknown |
Entry does not match any known function or column. |
White |
Valid state |
Entry is valid. |
Red |
Invalid state |
Function is valid, but Filter Column is not recognized. |
Gray |
Not Required |
Field does not require a value. This applies to the Filter Column or Filter Value fields for functions that do not return tabular data. |
Substitutions allow you to build open-ended displays in which data attachments depend on values defined at the time the display is run. Generic names, such as $function1 and $function2, are used instead of values for specific functions. Later when the display is running, these generic values are defined by the actual names of specific functions. In this way, a single display can be reused to show data from a number of different sources. For more information on creating displays using substitution values, see the “Substitutions” section.
From the Attach to Function Data dialog you can specify which table columns to display and in what order they will appear. In order to populate the listing of available columns, you must first select a function. See “Add/Edit Functions” for details on creating functions.
To bring up the Select Columns dialog, click on the ellipse button in the Column(s) field (or right-click in the Column(s) field and choose Select Columns). The dialog should contain a list of Available Columns.
To add a column, select an item from the Available Columns list and click on the Add button. If the item you require is not listed, type your selection into the Enter Column Name field. Click the Remove button to delete an item previously added to the Selected Columns list. You can control the order of columns in a table by arranging the items in the Selected Columns list with the Move Up and Move Down buttons.
“Validation Colors” indicate whether selected columns are valid. However, if even one column selected is invalid the Column(s) field in the Attach to Function Data dialog will register as an invalid entry.
Note: Invalid columns will not update.
If no data is available for a table row within a selected column, then the table cell will display one the following values: N/A, false, 0, or 0.0.
The following describes the Attach to Function Data dialog commands:
Command |
Description |
OK |
Applies values and closes the dialog. |
Apply |
Applies values without closing the dialog. |
Reset |
Resets all fields to last values applied. |
Clear |
Clears all fields. Detaches object from function (once Apply or OK is selected). |
Cancel |
Closes the dialog with last values applied. |