dropdownlist as a parameter

  • 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.

  • You may create a separate dataset for the productIds and define the parameter as Multi-value and associate this dataset to the parameter.

  • Thanks for your reply.

    Could you please explain how to do that.

    Thanks againl.

  • 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.


    Kindest Regards,

    Martin

  • 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.

  • 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


    Kindest Regards,

    Martin

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply