Skip to main content
A newer version of this page is available. .

Creating Parameters

  • 5 minutes to read

This topic explains how to create a new dashboard parameter and specify its settings.

Creating Parameters in the Dashboard Designer

To create dashboard parameters in the Dashboard Designer, perform the following steps.

  1. Click the Parameters button on the Ribbon’s Home tab.

    Parameters_AddParameterButton_Ribbon

  2. In the invoked dialog, click the Add button to add a new parameter.

    Parameters_ParametersDialog

  3. Specify the parameter’s settings.

    Settings

    Description

    API

    Visible

    Specifies whether the parameter editor is visible in the Dashboard Parameters dialog.

    DashboardParameter.Visible

    Allow Null

    Specifies whether or a not null value can be passed as a parameter value.

    Parameter.AllowNull

    Allow Multiselect

    Specifies whether multi-selection is enabled for the current parameter.

    The following limitations are applied to parameters with multi-selection enabled.

    • Use the is any of or is none of operators to pass a multi-select parameter to a filter criteria or to the Expression format condition.
    • Use the In or Not In operators to pass a multi-select parameter to a calculated field expression.
    • Custom SQL queries do not support multi-select parameters.
    • Stored procedures used in SQL and Entity Framework data sources do not support multi-select parameters.

    Parameter.AllowMultiselect

    Name

    Specifies the parameter name.

    When creating and modifying parameter names, follow the rules below.

    • A name can contain letters, numbers and underscores.
    • A name cannot contain spaces.
    • A name cannot be an empty string.
    • The dashboard cannot contain parameters with the same name.
    • Names are case-sensitive. For example, you can create the names Parameter and PARAMETER .

    Parameter.Name

    Description

    Specifies the parameter’s description displayed to an end-user.

    The parameter’s description is the value displayed in the Parameter Name column of the Dashboard Parameters dialog.

    DashboardParameter.Description

    Look-Up Settings

    Specifies the parameter’s look-up editor settings.

    DashboardParameter.LookUpSettings

    Select All Values

    Specifies whether be selected in the initial state of the Dashboard Viewer.

    Note that this option is in effect when Allow Multiselect is set to true.

    Parameter.SelectAllValues

    Type

    Specifies the parameter type.

    Parameter.Type

    Value

    Specifies the default parameter’s value(s).

    Note that when Allow Multiselect is set to true, the Value option allows you to select multiple parameter values.

    Parameter.Value

  4. Then, click OK to add the created parameters to the dashboard.

Look-Up Editor Settings

There are three types of look-up editor settings that can be specified for a parameter. Select the required type from the Look-Up Settings drop-down list.

Parameters_ParametersDialog_LookUpSettings

  • No Look-Up - set the Value to use a static value as a parameter.

    Parameters_LookUpSettings_NoLookUp

  • Static List - click the ellipsis button to add static values for the current dashboard parameter.

    Parameters_LookUpSettings_Static

  • Dynamic List - allows you to use a list of values from the existing data source as a parameter. Specify the following settings.

    Parameters_LookUpSettings_Dynamic

    1. First, select the required Data Source from the list of available data sources. For SQL or Entity Framework data sources, select the required Data Member that specifies the query/data member from the selected Data Source.
    2. Then, specify data members for the dashboard parameter’s value and display name using Value Member and Display Member, respectively.
    3. If necessary, specify the data member used to sort parameter values using the Sort By option. Sort Order specifies the required sort order.

    Note

    To learn how to create a data source for a dashboard parameter, see the Providing Data section.

    Note that you cannot specify an OLAP data source as the data source for the dashboard parameter in the Dashboard Designer.

Creating Parameters in Code

The Dashboard exposes the Dashboard.Parameters property, which provides access to a collection of dashboard parameters.

First, create a parameter with the required look-up editor settings (the DashboardParameter.LookUpSettings property), and then add it to the collection of dashboard parameters. The following code snippets show how to do this.

  • No Look-Up

    DashboardParameter parameter1 = new DashboardParameter("Parameter1", typeof(string), "Beverages", "Select a category:", true, null);
    
  • Static List

    Use the StaticListLookUpSettings.Values property to access the list of static values for the dashboard parameter.

    StaticListLookUpSettings settings = new StaticListLookUpSettings();
    settings.Values = new string[] {"Beverages", "Condiments"};
    DashboardParameter parameter2 = new DashboardParameter("Parameter2", typeof(string), "Beverages", "Select a category:", true, settings);
    
  • Dynamic List

    Use the DynamicListLookUpSettings.DataSource property to specify the required data source for the dashboard parameter. Optionally, you need to specify the DynamicListLookUpSettings.DataMember property that specifies the data member in a dashboard data source. Note that this property is in effect for the SQL or Entity Framework data sources.

    The DynamicListLookUpSettings.ValueMember and DynamicListLookUpSettings.DisplayMember properties allow you to specify data members for the dashboard parameter’s value and display value.

    DynamicListLookUpSettings settings = new DynamicListLookUpSettings();
    settings.DataSource = sqlDataSource;
    settings.DataMember = "Categories";
    settings.ValueMember = "CategoryID";
    settings.DisplayMember = "CategoryName";
    settings.SortOrder = DimensionSortOrder.Descending;
    DashboardParameter parameter3 = new DashboardParameter("Parameter3", typeof(string), "1", "Select a category:", true, settings);
    
See Also