Report Parameters - need to allow NULL value when using Available Values = From query -forces me to pick one?
I have a list of available values for a report from a query. HOWEVER, I want the option to select a NULL value because I want to let the user either pick one value or send NULL which will be the same as picking ALL values (or rather it won't filter by those at all in the query). This works fine if I do NOT provide a list of available values from a query, as it gives me the NULL check box. However, when I provide a list of values from a query I don't get the NULL check box and it REQUIRES me to pick a value. How can I either: A. be able to send a NULL value or B. add a null value to my SELECT query that populates the list of available values so that NULL will be an option in the drop down??? There must be some way around this as it seems like a very basic thing to want to do. Thank you. EDIT: I ended up allowing them to select multiple values, but it seems like there shoudl be a better way. ALSO, is it possible to DEFAULT to have ALL values selected (when it lets you select multiple values) so that they don't have to click on "Select All" but instead it will have already set that by default?
August 20th, 2008 9:08pm

Your best approach is to make the query into a stored procedure. That way you will have full control over input parms. Let us know if helpful.
Free Windows Admin Tool Kit Click here and download it now
August 20th, 2008 10:01pm

Even if I make it a sproc, I don't understand how that will get around the user interface generated by reporting services? The issue is that the drop down list of (in this case) employee names requires an item be selected. However, I want the option to send NULL but I NEED a drop down list as I can't rely on the end user to type someone's name properly (or well in this case it is sending EmpID but displaying the names as the label but you get the idea). So I don't understand how using a stored procedure will do anything about the report interface NOT showing a "NULL" check box and instead requiring a value be selected from the drop down list.
August 20th, 2008 10:07pm

Agreed on the multi-value drop-down. It is a challenge! This is a related workaround to set multi-value default as "all". This is how you can set the default value on multi-valueto other than "all". This thread is on multi-value parameters in stored procedures. Let us know if helpful.
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2008 12:21am

Thanks, I used the option to use the same query that populates the drop down list to also set the default values and it defaults to all values selected.
August 21st, 2008 4:27pm

So, what you're saying is that there is no way to do this without switching to an MvP for the parameter? If that's the case, that seems like a rather large flaw for something that seems like it should be pretty basic functionality... EDIT: There IS a way to do this without switching to multivalued parameters, though it's still less elegant than if things just worked the way it seems like the parameter options ought. The solution is documented at http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/e1806815-1b42-4432-9e4c-a0eeee2e5cc9. FWIW, I used " All Values" as the label and "All" as the value, and then set the defaults for all my optional parameters to "All." Seems to work fine.
Free Windows Admin Tool Kit Click here and download it now
February 24th, 2011 7:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics