Contents
Strategic Partner Links
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
SDK Examples
Parameters share some similarities to Custom Properties in Vision components in that they allow an Ignition user to specify dynamic data to be used in reports at runtime. For example, a manufacturer may want to generate reports for the active production lines every Monday morning, but you don't know ahead of time which production lines will be running. We can create a parameter called activeProductionLines and use an expression or Tag value to determine which lines were active, and use the parameter in a SQL Query datasource to only include data from active lines.
Parameters can be declared with an empty (null) value. In this event, it can be fed values from the Vision Report Viewer component, or in the Report Scheduling panel. The Report Viewer can use parameters to bind to data through Ignition Bindings. If a parameter is supplied a default value in the Report Data panel (we call these default parameters), that value will be automatically be supplied to the Report Viewer component. If a parameter has no default, the Report Viewer and Preview Panel will notify the user that a parameter is undefined. It is important to note that both Scheduled Report and Vision component parameters take precedence over default parameters, so any default parameter can easily be overridden while also providing a baseline value.
Note that default values for parameters are evaluated in the gateway, not by clients. As such, the expressions have a gateway scope.
When you first create a report, you start with two parameters: StartDate and EndDate. EndDate will have a default value of 'now()', while StartDate will have a default value of 'dateArithmetic(now(), -8, "hr")'. Notice how I changed the default value of the StartDate to be a difference of 10 days instead of 8 hours by modifying the Default Value expression. You can also delete both StartDate and EndDate parameters if you do not need date parameters in your report.
New parameters may be added by pressing the
button.Once created, a default value should be given to the parameter. In addition to expressions, you can also have your default value reference a Tag using the
button on the right of the expression area.
You can also use a literal value. Normal Expression languages syntax applies, so dates and strings must be wrapped in quotation marks, but numerical values can be written without quotes.
Finally, you can reference other parameters. In the example below, BoolParameter is referencing the value of IntegerParameter.
It is important to note that when referencing other parameters, you must type the name of the parameter exactly within a set of curly braces { }, including capitalization. Also, you can only reference parameters that are above the current parameter. Thus, while BoolParameter can reference the IntegerParameter, the IntegerParameter my not reference BoolParameter.