SSRS 2012: How to get a "Select All" that returns NULL instead of an actual list of all values from a multi-select parameter?

StackOverflow https://stackoverflow.com/questions/20802812

문제

I have a multi-select parameter that can have a list of thousands of entries. In general, the user will pick a few entries from the list or "Select All". If they check "Select All", I would much prefer that I get a NULL or an empty string instead of a list of all values. Is there any way to do that?

In experimenting with a work-around, I tried putting an "All" label with a null value in the list, but it is ignored (does not display in the drop-down). If I use an empty string for the value, my "All" entry does get displayed, but so does "Select All", which is confusing. Is there a way to suppress "Select All"?

  • Mark
도움이 되었습니까?

해결책

I adapted the following from a workaround posted by JNeo on 4/16/2010 at 11:14 AM at http://connect.microsoft.com/SQLServer/feedback/details/249227/multi-value-select-all-parameter-in-reporting-services

To get a null value instead of the full list of all values when "Select All" is chosen:

1) Add a multi-value parameter "MyParam" that lists the values to choose.

2) Add a DataSet "ParamCount" identical to the one used by "MyParam", except that it returns a single column named [Count] that is a COUNT(*) of the same data

3) Add a parameter "MyParamCount", set it to hidden and internal, then set the default value to 'Get values from a query', choosing "ParamCount" for the Dataset and the one [Count] column for the Value field.

4) Change the parameter for the main report DataSet so that instead of using [@MyParam], it uses this expression:

=IIF(Parameters!MyParam.Count = 
Parameters!ParamCount.Value, Nothing, Join(Parameters!MyParam.Value, ","))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top