Click here to Skip to main content
13,596,062 members
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 11 Feb 2008
Licenced CPOL

Workaround: When a user clicks "Select All", the report should pass a blank value instead of parsing everything in the MultiSelect DropDown parameter

, 12 Feb 2008
Rate this:
Please Sign up or sign in to vote.
If you have a long list of drop down items and you want to pass in one value, you can use this method


I had two problems when dealing with Reporting Services. This article address the following two issues.

1) Having a "null checkbox" in the drop down menu so that a user is not REQUIRED to enter a value for every multi select drop down.

2) If all the values are selected (i.e Select All is selected), all the values in the drop down are not passed into the query/stored procedure since it will hamper the performance.

The image above shows the null checkbox and all the values selected.


My client refused to have an application layer on top of Reporting Services. So everything had to be done in the Report itself. With many limitations that come with Reporting Services, there were only so many ways to handle the problems (as described above)

Creating the Null Checkbox

So how do we let the Report run, without selecting a value in the drop down multi select checkbox. Unfortunately, you cannot pass a blank value/null value by default. You have to select atleast one value.

My solution to the problem was creating a null checkbox. The way to create it, is as follows:

1) Create a New Dataset, call it (for example) EmptyDS.

2) Write the following Code in it

SELECT ColumnName FROM TableName UNION ALL SELECT '' AS Expr1 ORDER BY ColumnName

3) Go to the Design View, and open Report Parameters. After selecting the Parameter, under default values, select "From Query" and select EmptyDS.

And thats it, you have your null checkbox

Passing blank value instead of all the values in the dropdown.

There were so many suggested ways of doing this. Only one worked for me.

1) Firstly, we need a new dataset the counts the number of values in the particular parameter. So we create a new dataset called, for example, CountDS.

2) Then ,you click on the data tab, and enter the properties of the dataset where you are passing the report, instead of adding =Parameters!DataSetName.Value, I changed it to the expression with =if(..). For example,

=iif(Parameters!DataSetName.Count>=Paramet<wbr />ers!CountDS.Value<wbr />, "",Parameters!DataSetName.Value


This way, your query/stored procedure doesnt eat up your server's resources with a drop down menu with a lot of values being passed into the Stored Procedure.

Points of Interest

They need to add more functionalities to Reporting Services. If the client is not interested in an application layer, it can become really challenging to give Reporting Services the functionalities of a proper application.


Posted February 12, 2008


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Shobhit Dixit
Software Developer
United States United States
I have been a developer for over 3 years specializing in .NET technologies in both Winforms and Webforms.

You may also be interested in...

Comments and Discussions

QuestionSkip the Server Roundtrip for a count Pin
Anna Brown28-Jun-13 7:04
memberAnna Brown28-Jun-13 7:04 
GeneralMy vote of 5 Pin
Anna Brown28-Jun-13 6:58
memberAnna Brown28-Jun-13 6:58 
QuestionDeselect all the items in drop-down Pin
dhirenipatel15-Sep-11 0:05
memberdhirenipatel15-Sep-11 0:05 
GeneralGood job Pin
T.Ashraf5-Sep-08 7:17
memberT.Ashraf5-Sep-08 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180621.3 | Last Updated 12 Feb 2008
Article Copyright 2008 by Shobhit Dixit
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid