In this article, we will learn how the Filter changes its default values during Parameter selection in SSRS Reports with Examples.
I have 4 parameters in my report:
- Start Date: Default is today’s Date
- End Date: Default is today’s Date + 60 Days
- Department: No Default value.
- Project: Dependent Filter on Department. Once the Department is selected, default all projects will be selected.
Below listed is various test cases which shows how the Select ALL in Project Filter changes according to other 3 parameters.
- Default Filter:
- Start Date: Current Week Start Date
- End Date: Today’s Date+ 60 days
- Department: Select all manually
- Project: Disabled
Results: All projects will be automatically displayed and selected based on dates and Department.
- Selecting wide range of Dates after Initial run (After Step 1):
- Start Date: less than Current Week Start Date or Current Week Start Date
- End Date: Greater than Today’s Date+ 60 days
- Department: Select one manually
- Project: Not all the Projects will be selectedResults: All projects between the date range will be displayed but the projects after today’s date + 60 will be un-selected.
- Selecting more Department (After Step 2):
- Start Date: Any
- End Date: Any
- Department: Select two department
- Project: Not all the Projects will be selected
Result: All projects between the date range and department will be displayed but the projects in newly selected department will be un-selected. In this example, projects in Assurance Department will not be selected.
- Dependent filter (Project Filter) will be disabled initially.
- Dependent Filter will be displayed and open once all the other filters are selected.
- Dependent Filter will change based on the other Filters change. After initial run, any change in other filter will control the behavior of Dependent Filter.
- Selecting Wide Range initially and then reducing the Range will keep the Dependent Filter as Select All. E.g.: Decreasing the Date Range or Selecting less number of department selected initially.
- Selecting a range initially and then increasing the range will remove Select All in Dependent Filter (Only the initial range Project will be selected). This the default SSRS behavior. E.g. Increasing the Date Range or Selecting more departments selected initially.
- EXCEPTION: If you increase the Date Range and then Reduce the Department Selected, All Projects will be selected by default.