The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Pass a Dashboard Parameter to a Filter String

  • 3 min to read

This tutorial demonstrates how to pass a dashboard parameter to a dashboard item's filter string using the WinForms Dashboard Designer.

Our dashboard is already connected to the SalesPerson view of the Northwind database. The Grid dashboard item is bound to the CategoryName and Extended Price fields.

ParameterFilterTutorial_SampleGrid

Suppose that you want to filter the Grid dynamically by selecting the required category or several categories. To do this, perform the following steps.

Create a Query

To add the query containing category names, click the Add Query button in the Query group on the Data Source ribbon tab.

ParameterFilterTutorial_AddQueryButtonRibbon

In the invoked Query Editor, click the Run Query Builder... button.

ParameterFilterTutorial_EmptyQueryEditor

The Query Builder will be invoked. To add the Categories table to a query, double-click this table and select all columns.

ParameterFilterTutorial_QueryBuilder

Click OK. The Query Editor will display the generated SQL query.

ParameterFilterTutorial_QueryEditorWithQuery

Click Finish to add the Categories query to the data source.

Create a Parameter

To create a dashboard parameter, click the Parameters button in the Home ribbon tab.

Parameters_AddParameterButton_Ribbon

In the invoked dialog, click Add to create a new parameter. Then, specify its settings in the following way.

ParameterFilterTutorial_SpecifyParameterSettings

  • Set Allow Multiselect to Yes to allow end-users to select multiple categories.
  • Specify the Description that will be displayed in the Dashboard Parameters dialog for this parameter.
  • Set Look-Up Settings to Dynamic List to use a list of categories from the Categories query as parameter values.
  • Specify the Data Source and select the Categories query as the Data Member.
  • Select the CategoryName field from the Value Member drop-down.
  • Leave the default parameter's type (String) and specify the default parameter value as Beverages.
  • Finally, change the default parameter name to categoryParameter.

Click OK to create the dashboard parameter.

Pass the Parameter to a Filter String

To pass the created parameter to a filter string, select the Grid and click the Edit Filter button in the Data tab.

DataShaping_Filtering_EditFilterButton

In the invoked Filter Editor, click the FilterEditor_EU_AddButton button to insert a new condition.

ParameterFilterTutorial_EmptyFilterEditor

Make sure that the CategoryName dimension is selected in a created condition. Then, select the Is any of criteria operator from the list.

ParameterFilterTutorial_FilterEditorIsAnyOf

Click the Parameters_FilterEditor_CompareButton button next to the <enter a value> operand value, then click the Parameters_FilterEditor_CompareButton2 button. The categoryParameter will be selected as an operand value (note that the Parameters_FilterEditor_CompareButton3 icon will be displayed next to the selected parameter).

ParameterFilterTutorial_FilterEditorParameter

Click OK. You can now filter the Grid by selecting the required categories in the Dashboard Parameters dialog. To invoke this dialog, click the Parameters button in the dashboard title.

ParameterFilterTutorial_DashboardParametersDialog

Select required categories in the Value column, click OK and click the Submit button. The Grid will be filtered according to the selected categories.

ParameterFilterTutorial_FilteredGrid

See Also