I'm not sure I've used that before. I do have a VB.net solution that takes the value of a dropdown box and passes it to a report. Would you like that code?
--------------------------
Web/.net Programmer & DBA
Central PA
Are you saying you have a .NET app which has a dropdown list that you need to pass to a parameter in a SSRS report or that you have created an SSRS report which has a report parameter which has a list of values that you want to pass to the SQL which generates the data?
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
Thanks for your reply.
I'm not writing any .Net code. I just created an SSRS report which has report params. One of them is a dropdownlist, which I'd like to pass its selected items to my sql function in a comma delimited format (UserSelectedCountries).
My code is:
SELECT companies,Countries
FROM [ReportsDb].dbo.MyTable
WHERE [dbo].[fn_FindStringInString](CampanyCountries,UserSelectedCountries) ='TRUE'
Not sure about splitting the list but the default way to pass a param to SQL in SSRS is:
WHERE FieldName = @ParameterName
so in your case, something like:
SELECT companies,Countries
FROM [ReportsDb].dbo.MyTable
WHERE [dbo].[fn_FindStringInString](CampanyCountries,UserSelectedCountries) ='TRUE'
And ProductID = @ParameterName
should work - substituting in your parameter name and field name - if you need to pass more than 1 product ID, I think you have to use something like a "split" function to convert the values to a comma seperated string but I am on SSRS 2000 that doesn;t have this functionality so can;t say for sure
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.