Source Data Expression
The Source Data Expression is an Iotellect Expression that is evaluated every time when a report is launched and shown to the user. This expression must evaluate to a Data Table. An error condition will occur if this expression evaluates to any primitive type, such as Boolean, Integer or String. Data from the Data Table produced as a result of the expression is used to fill in the report template and prepare the report.
For relative reports, this expression may contain references with relative context paths. When a relative report is launched, any relative references will be resolved in relation to the context from which the Launch Report action has been selected. If the report is launched using the Show Report action of the report context, or from the Report Editor, relative references will be resolved relatively to the context specified by the report's Default Context property.
Source Data Expression Resolution Environment: | |
For an absolute report, the report context itself. For a relative report, a context the report is launched for. | |
Report parameters table (if report is parameterized ). | |
0 | |
Standard variables only. |
![]() | Example: If an absolute report is designed to show data retrieved by a query, its Source Data Expression should contain a reference to the data variable defined in the query context. So if a query is called traffic_stats and belongs to the admin user (this actually exists as a pre-defined query ), we can get the following Source Data Expression:
|
![]() | Example: Here is a Source Data Expression of a relative Attendance Report:
This source data expression refers to an attendanceData function from an attendance context. During evaluation, this function is called with one parameter, the path of the context from which the Attendance Report launch action has been selected (or the Default Context's path, if the report is started in test mode from Report Editor ). See Standard References section for an explanation of why |
![]() | Example: The below expression of a relative Alert History report loads historical alert events from the database and returns them in a table. Only a few of alert fields selected by
See Selecting and Processing Events tutorial for more information. |
Default Context for a Report
Simply speaking, the default context is a report property used for resolving references in the Source Data Expression when no "target" is specified on launching a relative report. It is used in two cases:
- When launching a relative report directly, without selecting a "target" context first.
- When building a report in test mode from a Report Editor.
When the relative report is launched using a Launch Report action (the "classic" use case), relative context paths in references appearing inside the Source Data Expression are resolved relatively to the path of the context from which the Launch Report action has been started. The Default Context property is not used in this case.
Was this page helpful?