SQLTeam.com | Weblogs | Forums

SSRS passing multiple values in a parameter

sql2008

#1

I have a requirement to pass multiple values as a default value in a parameter.
For eg. country parameter Select All has 5 Values - Australia,Japan,US,UK,China. When the report runs by default i need to show only US,UK ie, only US and UK has to be ticked and their corresponding data has to be displayed in the report.

Can you please help me how to achieve this.

Thanks in advance.


#2

In parameter properties, in the general tab, check the "Allow multiple values" checkbox. Then, in the Default Values tab of the same dialog, select Specify values button and use the Add button to add as many values as you want.

The values will be sent to the query as a comma-separated string. You will have to write the query to allow for this, by parsing the comma-separated string to get the values.


#3

Thanks for the reply. In the default values of the parameter can i add the values in a single string? or expression? like : Value expression ="US","UK","China"


#4

You can add another dataset by selecting "US","UK","China" in the where clause and use this dataset for Default Value.