June 9, 2014 at 2:27 am
I have a report dataset reading from a database table (OLTP), I'm able to set the default to 'Select All' but this displays all the values separated by a coma, how do I set this just display 'All'
June 10, 2014 at 7:13 am
If I understand this correctly, you want to show all the rows from your table, plus an option showing literally the word "ALL"?
This is quite easy as long (as you don't want a multiple select parameter) - you just need to have a query like this as the source of your parameter values:
SELECT description, ID FROM ParamTable
UNION ALL
SELECT 'ALL' description, 0 ID
ORDER BY ID
(Assuming that you don't have a zero ID in your table, otherwise use any value for ID that you're sure won't appear in the table).
But then you have to code for the ZERO that you'll be passing from your report to your underlying SQL code,
So you might have something like :
SELECT colA, colB, colC FROM YourTable WHERE colD = @YourSSRSParm
and if you want to return all the rows with no filter if you've chosen the 'ALL' parameter with a zero value, you'd need to change it something like:
SELECT colA, colB, colC FROM YourTable WHERE CASE WHEN @YourSSRSParam = 0 THEN 0 ELSE colD END = @YourSSRSParm
If you DO want to have a multiple select parameter - then SSRS will pass back a string of comma separated values and you'll have to code for that in your stored procedure, converting that string to a table then right joining it to it or using IN - there are many publicly available examples - using a table function is quite easy.
June 10, 2014 at 8:13 am
Thanks for the reply, will test this and let you know. My concern with thIs is it seems as if it will retrieve all the values in the table making my parameter dropdown list very long. Is there a way that we could use distinct?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply