Thursday, May 7, 2015

How to display “All Selected” when parameter (Select All) is selected in SSRS?

Hi greene303,

Per my understanding that the parameter Name2  is the cascading parameter which depend on the parameter Class1, when you "Select All" of the Class1 the Name2 will show null and you want all the parameters to show "Select All", right?

I have tested on my local environment that if you have specified both the "Available values" and "Default value" for all the parameters, you issue can be caused by some of the fields include the null values, so when you create an multiple values parameter, you can't set to allow null values, this will cause the show null in the parameter.

In your scenario, you can modify the query in the dataset to add text "NULL" and also change the filter to all the filter of both NULL values and not null values.

Details information about how to achieve this for your reference:

  1. For the independent parameter, please modify the query like below to add Text "NULL" in the parameter dropdown list:
    SELECT     distinct  Class1
    FROM       TableName
    where  Class1  is not null
    UNION
    Select '(NULL)'
  2. For all the cascading parameters, please modify the query like below to add Text "NULL" in the parameter :
    SELECT     distinct Name2 
     from TableNamewhere  ISNULL(Class1,'(NULL)')  in (@Class1) and Name2 is not null
    UNION
    Select '(NULL)'
  3. Modify to add the filter in the main dataset's query like below to filter both the null and not null values:
    SELECT  * from case0203
    where ISNULL(Class1,'(NULL)') in (@Class1) and ISNULL(Name2,'(NULL)') in (@Name2)
  4. Preview like below:

More details information:
SSRS: Multi-Value Parameters and NULL values

If you still have any problem, please feel free to ask.

Regards,
Vicky Liu


Vicky Liu
TechNet Community Support


No comments:

Post a Comment