Desktop User Guides > Professional > Table scripting > Table presentation > Indicating table status in UNICOM Universal Gateway (UniGW)Events
 
Indicating table status in UNICOM Universal Gateway (UniGW)
If you are using UNICOM Universal Gateway (UniGW), you can indicate status at table level. The UniGW dashboard can display information about interviewing reports: a list of tables which are highlighted according to their status. For example, you might configure the “Queue Status” report to appear in the dashboard so that you can see at a glance if any participant/sample queue needs attention.
(Table status can also be used when integrating with third‑party applications. It is not used in Reporter or Survey Tabulation).
To integrate with UniGW, set Table.Status to “ok”, “warning”, or “error”. For example, you might decide that if any cell in the table is red (see Highlighting cells: Status cell item), the table status should be “error”. To check the status of a cell, use the Table.HasCellStatus() method.
See also:
Table.Status
Example
The following script could be run after every table population, so it can be used in the OnAfterPopulate event. The script is then stored in the .mtd file to be run by Reporter or Survey Tabulation, or through the Interviewing Reports web service to to integrate with UniGW or other dashboard systems.
If Table.HasCellStatus("R") Then
Table.Status = "error"
ElseIf Table.HasCellStatus("Y") Then
Table.Status = "warning"
ElseIf Table.HasCellStatus("G") Then
Table.Status = "ok"
Else
Table.Status = ""
End If
See also
Table presentation
Table properties
The Properties collection on the Table object contains a collection of Property objects. Each property consists of a name and value and controls a table option, such as what to display for percentage values that are rounded to zero. The table properties automatically take their values from the corresponding properties in the Document.Default.Properties collection. This means that you can set up default properties for all new tables and optionally overwrite one or more of them on individual tables. Changing the default properties does not change the properties of tables that have already been created.
Recognized table properties
AdjustRounding
Rounding anomalies mean that row and column percentages created from single response variables do not always add up to 100%. This property has a Boolean value that controls whether the rounding of row and column percentages is to be adjusted so that they add up to 100%. See Rounding for more information.
Default value: False
AutoBaseSpecification
Defines the specification for the base element that the Table Object Model automatically adds to tables with no base. This enables you to change the label, hide the autobase, or base it on an expression.
AutoUnweightedBases
Controls whether the Table Object Model automatically adds an unweighted base element to all weighted tables. For more information, see Base element.
Default value: True
AutoUnweightedBaseSpecification
Events
Events are predefined objects that specify actions that are to take place at certain points in the script.
The only event available is OnAfterPopulate.
OnAfterPopulate event
The OnAfterPopulate event runs directly after population occurs. Use it to run a script in Reporter after a table is generated. For example, you can use it to:
calculate the status of the table (Table.Status): see Indicating table status in UNICOM Universal Gateway (UniGW)
create a table item that is not available in Reporter, but that can be calculated and hardcoded into the table by using the DefinedValues function.
Example
This example shows how to set the Table.Status.
Table.OnAfterPopulate = "!
If Table.HasCellStatus("R") Then
Table.Status = "error"
ElseIf Table.HasCellStatus("Y") Then
Table.Status = "warning"
ElseIf Table.HasCellStatus("G") Then
Table.Status = "ok"
Else
Table.Status = ""
End If
!"
See also
Table scripting
Working with metadata
When you work with the Table Object Model, you can access the metadata in the MDM Document using the Table Object Model Document.DataSet.MDMDocument property. The MDM Document is returned in no-save mode, which means that any changes you make are not saved.
The MDM Document, part of the Metadata Model, is documented in the Data Model section of the UNICOM Intelligence Developer Documentation Library. See Working with the Metadata Model.
See also
Working with versions
Working with labels
Working with languages
Table scripting
Working with versions
Sample Script Files: WorkingWithVersions.mrs, RDBTables.mrs.