Export (0) Print
Expand All

Associate a Query Parameter with a Report Parameter (Report Builder and SSRS)

When you define a dataset query that contains a query variable, the query command is parsed. For each query variable, a corresponding dataset parameter and report parameter are created. The dataset parameter points to the report parameter. This enables a user to enter a value that passes directly to the query. Each time you edit the query command, the same process takes place.

If you rename a report parameter that is bound to a query parameter, you need to manually link the query parameters to the renamed report parameter by using the procedure in this topic.

Note Note

You can create and modify report definitions (.rdl) in Report Builder and in Report Designer in SQL Server Data Tools. Each authoring environment provides different ways to create, open, and save reports and related items. For more information, see Designing Reports in Report Designer and Report Builder (SSRS) on the Web at microsoft.com.

To associate a query parameter with a report parameter

  1. In the Report Data pane, right-click the dataset, click Dataset Properties, and then click Parameters.

    Note Note

    If the Report Data pane is not visible, click Report Data on the View menu.

  2. In the column Parameter Name, find the name of the query parameter. Parameter names are automatically populated based on the query. Every time you change the query, the query is checked for new query parameters. Query parameters that you create manually are not changed when the query changes.

    • In Parameter Name, find the query parameter name as it exists in the query. You can also manually add a new query parameter and enter a name.

    • In Parameter Value, type or select an expression that evaluates to the value to pass to the query parameter. This is typically the name of the report parameter.

      Note Note

      You are not limited to report parameters as values for a query parameter. You can use any expression that evaluates to a value for the parameter value.

  3. Repeat step 2 for additional query parameters.

Community Additions

ADD
Show:
© 2014 Microsoft