October 6, 2008 at 2:06 am
Hi All,
I have a dropdownlist which contains different ProdutIds.
I have to use the values from the dropdownlist as a parameter to the report. How to use the dropdownlist to the Report?
I'm using the Visual Studio .NET integrated Report Designer.
In the data section of the integrated report desinger my code is something like this:
SELECT
FROM
Sales.SalesLog sl
WHERE
sl.transactionDate BETWEEN @startDate AND @endDate
AND [dbo].[fn_FindStringInString](FullNameCountries,@productId) ='TRUE'
I'd like to replace the @productId with the values selected by user from the dropdownlist which will be passed to a sql function which expects comma delimted string.
Thanks for your help.
N.
October 6, 2008 at 4:07 am
You may create a separate dataset for the productIds and define the parameter as Multi-value and associate this dataset to the parameter.
October 7, 2008 at 4:58 am
Thanks for your reply.
Could you please explain how to do that.
Thanks againl.
October 8, 2008 at 2:53 pm
SRS multi-select lists are in a comma delimited format by default... have you tried just binding the report parameter to the @productid variable? It should work from what you are saying in your post.
Martin
October 9, 2008 at 3:53 am
Thanks for your reply.
I tried that and it works if I select just one item from the dropdownlist.
When I select more than one item I get the following error:
"Procedure or function dbo.fn_FindStringInString has too many arguments specified"
When I run the same query in qurey analyzer and replace the parameter with a comma delimited string like this:
[dbo].[fn_FindStringInString](fullnamecountries,'Fiji,Austria')='TRUE'
it works fine!
Any advice?
Thanks again.
October 9, 2008 at 5:34 pm
i'd say that the comma del string is being passed in as separate params to your function eg...
[dbo].[fn_FindStringInString](fullnamecountries,'Fiji','Austria')='TRUE'
you could either use a stored procedure and set the param as a varchar or you could build up your sql as a string and execute it
HTH
Martin
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply