Shoaib Maroof
Shoaib Maroof

Reputation: 369

SSRS report. Select All in the drop down parameter

I am aware that there is a - allow multiple values - option for a parameter in SSRS that allows for a select all option in the drop down but I do not want to have multiple selects.

So, is it possible to have a select all option for an SSRS parameter, whilst only being able to select on one option at a single time

e.g. my current parameter is 'Select a football team' - Arsenal - Chelsea - Liverpool - Manchester United

I want to have an option of 'Select All' to be available e.g. - Select All - Arsenal - Chelsea - Liverpool - Manchester United

I think it may be possible with some sql code that I can plug into along with my dataset but I am not sure how to do it...

Upvotes: 1

Views: 1196

Answers (1)

Sudipta Mondal
Sudipta Mondal

Reputation: 2572

In the FC_Name parameter's data set SQL, use something like the below

select 'All' fc_name
union
select fc_name from table_name -- considering "Arsenal, Chelsea etc is coming from a table"

In the dataset query for Fetching the report values, add something like -

if @fc_name_parameter = 'All'
     select ...
       from ... -- Query to not have a where condition for FC name.
else
     select ...
       from ...
      where fc_name = @fc_name_parameter

Upvotes: 1

Related Questions