简体   繁体   中英

How to change SSRS default multi-value parameter

I have a multi-value parameter for States that is populated by a string passed from SQL. The default in SSRS is for the State parameter to look like this: AL, AR, AZ, CA...

Is there a way to change this so that the default shows just one value, such as "All" instead of listing the entire string? I was able to do this years ago when our SSRS system was built on a .NET framework, but I don't see how to do this straight out of SSRS.

Thanks.

I did this before but you kind of have to play tricks. I cant remember the exact syntax but hopefully this can get you started.

First I had to add an option of all to the datasource query

Select State From StateList
Union
Select "All"

Then there was something that I did to make sure that the all check box was mutually exclusive to checking individual entries. Also it would only work if the All option was checked not if all states were individually checked.

Then in the report query change

Where State In (@StateParam)

To

Where (@StateParam = 'ALL') Or State In (@StateParam)

I hope this helps. If someone knows an easier or more straightforward way I would love to know how.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM