Groups | Blog | Home
all groups > sql server reporting services > september 2006 >

sql server reporting services : Selecting 'All' from the Data tab in Visual Studio


nthompson NO[at]SPAM gmail.com
9/6/2006 3:38:49 PM
This has been bugging me for ages....

In the Data Tab when you run a query to preview the data before it gets
merged with the layout, Visual Studio will prompt you for the values of
any parameters it needs.

What do you have to enter in order to view all results? (ie. to get the
equivalent of selecting '(Select All)' from the parameter dropdown in
the Preview tab?). Is there some kind of wildcard?

Cheers

Nick
magendo_man
9/7/2006 1:26:02 AM
It depends what you have done in your query/stored procedure to allow for an
ALL selection. It is common practise for a parameter display of ALL to be
linked to a null value. If that is the case then in the Data tab parameter
drop-down list you can select <null> rather than type anything in yourself.

HTH

------------------------
Magendo_man

Freelance SQL Reporting Services developer
Stirling, Scotland


[quoted text, click to view]
nthompson NO[at]SPAM gmail.com
9/7/2006 2:40:43 AM

I normally set up a report parameter which is populated from the query
(so that all data displays by default when you run the report), and use
a filter like IN(@varname).

When I run the data from the data tab it will prompt me for a value for
varname, which it will default to null. If I accept that and just press
OK then I get no records returned. So I'm wondering what I need to
specify as a value so that it gets all records...?

Thanks for your help!

Nick
magendo_man
9/7/2006 3:11:02 AM
I think you just need a percentage sign %

------------------------
Magendo_man

Freelance SQL Reporting Services developer
Stirling, Scotland


[quoted text, click to view]
nthompson NO[at]SPAM gmail.com
9/7/2006 5:57:23 AM

It will only accept a % for parameters that are text fields, and even
then unfortunately it won't actually execute ("The specified prepared
command ID is invalid"). I get the same with an asterisk.

Any other ideas? Surely there must be a way to wildcard the data!

Thanks
magendo_man
9/7/2006 6:29:02 AM
I'm not sure of your exact requirements. However, I think I would probably
replace the IN(@varname) in your WHERE clause with something like:

WHERE (MyVar=@varname OR @varname IS NULL)

This will allow you to enter either one numeric value, in your example, or
NULL. If NULL is entered then you will select rows with all values of MyVar.

HTH

---------------------
Magendo_man

Freelance SQL Reporting Services developer
Stirling, Scotland


[quoted text, click to view]
AddThis Social Bookmark Button