Report Parameters

The Report Studio is still under development and has not officially been released. Be warned that code may change such that reports you create with this pre-release trial version might need to be updated in order to continue working after your next VTScada update.

Until the official release, documentation for the Report Studio will open in response to the F1 key but will not be shown in the menu system. To view a table of contents for the complete chapter, navigate to Report Building (Report Studio)

Report parameters are used for selecting specific variables to use for your report. For example, if your application has several modular stations and you would like to produce the same report individually for each station, then you can use a tag type report parameter and select different tags each time a report is run to change the focus of the report.

Report parameters might also be used in Data Sets to keep a variable flexible, to prompt Operators to confirm a variable, or as a soft accountability measure.

When running a parameterized report from the Reports Page, if a default value is not set, the operator will be prompted for the necessary values when the report runs.

Within the Report Studio you can do the following:

  • Create custom report parameters
  • Manage report parameters and set defaults
  • Leave default values blank and prompt for values at runtime.
  • Use report parameters in Data Sets
  • Use report parameters in phrases

Manage Parameters and Parameter Values

Use the tools in the Report Studio ribbon to add and modify parameters or assign values in a report:

Manage, Add, Report Period

The Manage Parameters button opens a dialog where you can create new parameters and modify existing ones.

The buttons along the bottom of this manager allow you to add, edit, rearrange and delete parameters.

Adding a parameter opens a New Parameter dialog:

New Parameter dialog

Adding a tag parameter. The type is a user-defined tag in this example

The example shows a new parameter being configured. Recommended practice is to ensure that the parameter name is unique, avoiding any conflict with tags or other named objects. The description field should guide developers or operators when selecting the tag or value for the parameter. If the parameter is of type tag, then you should guide the user by selecting which types can be used. You may use the Ctrl key to select several types.

The same dialog is used when editing existing parameters.

Parameterized pages, plain widgets, and the Report Studio use parameters in the same way and share configuration dialogs.

(For pages and widgets only.) Text parameters can be marked as non-translatable. Select this for text that should never be translated, such as I/O addresses.

 

Values for Parameters

Use the Values tool in the Report Studio to set display values for use while building the report. This allows you to preview the effect of a parameter while continuing development work.

These values are saved as part of the report definition and will be used as defaults if other values are not provided when running the report.

Use Parameters in Tag Queries

After creating a parameter, you can use it in your tag queries and parameterized text. Tag queries assume that the parameter will contain a parent tag and do not work otherwise.

The following is easier to do if you use the Values tool to select a tag whose child tags should be displayed while you continue configuration.

Working in a Tag Query, set the Context to a parameter that contains a tag as shown in the following example:

Data cell properties allow you to name and define a set of data points to chart.

A Data Set with a context used as a parameter

Open the Tag Selector. The available tags are limited to child tags of the one associated with your parameter.

Select the tags for your report or create a query as shown in the preceding example.
(|*running | * | * | * |, which is any tag whose name ends with "running".) In a query, "Field" will be "value" for every tag except certain custom-code tags and communication drivers (see Communication Driver Log-Enabled Variables)

Use Your Parameters in Report Text

Parameterized phrases are different than report parameters. These are phrases that contain plain text and tokens that hold the place of variables like start time or tag names. If you have added customized report parameters to your report, the will become available in parameterized phrases.

In a text component, open the Parameterized Phrase editor from the properties panel. In the parameterized phrase maker dialog, click the big [+] button to the right of the text field to open a drop-tree of selections.

A long button with an addition sign is next to the text field. Clicking it opens a drop-tree of options such as StartDate, EndDate, RunTime and all added custom report parameters.

Many selections have child options to display only a portion of the variable. For example, %[StartDate] will display the start date when the report was run but %[StartDate.DayNum] will only show the day. Custom tag parameter selections are grayed out and you must specify the variable to be included. These include Name, Shortname, Description and Value.

See Parameterized Phrases for more detail about parameterized phrases.

Supply Parameter Values when Running the Report

When running your parameterized report from the Reports Page, users will be prompted to provide values for the parameters.

Use the tag selector to assign a tag to the parameter

Sample prompt for a parameter when running the report

If configuring a Report Tag to run your report, you can set values for your parameters in the tag as shown in the following image. To run the report for multiple stations, create multiple Report tags.

Use the tag selector to assign a tag to a parameter in reports generated with the report tag.

Setting a parameter value in a Report tag