Pass Parameter Values in WinForms Designer
- 3 minutes to read
This topic describes how to pass the created dashboard parameter to a dashboard. For instance, you can include a dashboard parameter in a WHERE clause of the SQL query or dynamically filter a dashboard according to the parameter value(s).
The created dashboard parameter can be used in the scenarios below.
SQL Queries
You can filter the SQL query dynamically if you pass a dashboard parameter to an SQL query or stored procedure. The resulted query has the WHERE clause that contains a parameter bound to the dashboard parameter value.
Follow the steps below to include a dashboard parameter in an SQL query or stored procedure in the Data Source wizard or Query Editor:
- Create a new query parameter or select the existing query/stored procedure parameter.
Enable the Expression check box for this parameter and select the dashboard parameter in the Value column.
The dashboard and query parameters are bound. You can select Expression editor… and specify an expression to bind a query parameter to a dashboard parameter with custom logic. For more information, see Pass Query Parameters.
Filtering
You can use dashboard parameters when you create a filter expression in the Filter Editor.
In the Filter Editor, you can compare a field value with different objects such as static values, values of another field, or parameter values. Use the button placed next to the operand value to switch between modes.
To compare a field value with a parameter value, click the button and then the button.
Then, click the operand value to invoke the list of available parameters and select the required parameter.
EF Data Source - Stored Procedures
You can pass an existing dashboard parameter to use it as a stored procedure parameter if you use a stored procedure from the Entity Framework Data Source.
To do this, enable the Expression check box and select the required dashboard parameter from the invoked combo box. You can also use the Expression Editor to specify the expression.
Conditional Formatting
You can apply conditional formatting to a specific dashboard item according to the current parameter value when you create the Expression format condition. It allows you to dynamically format dashboard item elements depending on the current parameter value. In the Expression dialog, you can compare a field value with parameter values in the same manner as in the Filter Editor dialog.
Calculated Fields
You can use parameters when you construct expressions for calculated fields. This allows you to dynamically evaluate values of the calculated field depending on the current parameter value.
To include the required parameter in the calculated field expression, click Parameters in the Expression Editor dialog and double-click the required parameter.
Window Calculations
Use parameters to dynamically apply a calculation based on the current parameter value when you customize expressions for window calculations.