Cascading Report Parameters
- 3 minutes to read
You can create cascading parameters to filter a list of predefined parameter values based on values in another parameter.
Tip
Refer to the following topics for information on how to create a list of predefined parameter values:
Create Cascading Parameters
Follow the steps below to create cascading parameters in the Visual Studio Report Designer:
Create a report parameter you want to use to filter values of another parameter.
Create a report parameter whose values you want to filter. Click the Filter String property’s ellipsis button in the Add New Parameter dialog and specify a filter string that references the parameter you created in the first step.
Note
In a filter string for a parameter’s look-up values, you can reference only those parameters that you created before the parameter whose look-up values you want to filter. You can use the Report Parameters Editor to change the order in which you created the parameters. To invoke the editor, right-click the Parameters node in the Field List and select Edit Parameters.
In the report’s smart tag, click the Filter String property’s ellipsis button. In the invoked FilterString Editor, specify an expression that uses both parameters to filter report data:
The following image illustrates cascading parameters where the Product parameter values are filtered by the selected Category.
Cascading Parameters Filtering Specifics
Cascading parameters can be filtered on the database level (server side) or on the application level (client side). For the following datasources, such parameters are filtered on the database level:
In case of SQL databases, database level filter operations do not work for stored procedures and custom SQL queries. For such queries, filters are always applied on the application level.
When your report is bound to one of the above datasources, and you change the value of the primary parameter (for example, the Category parameter in the image above), your application does the following:
- Makes a request to a database.
- Applies a filter on the database level (for example, filters the values of the Products parameter based on the Category parameter value).
- Loads the filtered data to your report.
You can also apply filter operations for the mentioned datasources on the application level. For this, set a filtered cascading parameter’s DynamicListLookUpSettings.UseServerSideFiltering property to false.
For the rest of the datasources, filter operations for cascading parameters are always applied on the application level.