SSRS Report Parameters - Multi Select

  • Hi Folks,

    I have a report and there are 2 parameters. Country and Sku. Country is drop down and sku is empty text box. I will select any country from drop down and i will type the SKU (for ex : CWF-01377) and then click view report.

    Now the new requirement is, in SKU parameter, i need to mention 1 or more values (comma seperated) and then i need to get the report. (for ex : CWF-01377, CWF-01378, ...)

    so i select one country.....type 2 or 3 SKU with comma seperated and then click view report.

    Is anyone familiar with this kind of stuff.

    Thanks,

    SK

  • You can use Jeff Moden's 8K splitter (from this site) to create a table object containing the comma-separated values & then inner join this to the query to filter the results. - That's if you are using a stored procedure.

    If the query code is written directly in the report you can just put the comma-separated parameter in an 'IN' stmt e.g.

    where SKU IN (@SKU)

  • The previous posts are right online:

    http://www.mssqltips.com/sqlservertip/2866/sql-server-reporting-services-using-multivalue-parameters/[/url]

  • Thanks for the comments...

    but my parameter is not a drop down....its a empty text box where i should enter year seperated by comma.

    Ex : 2007, 2009, 2013...

  • It doesn't make any difference - you would handle the resulting parameter in the same way.

  • Hi

    Did you try using the split() function ?

    =split(Parameters!SKU.Value,",")

    You can affect the result into another parameter or simply add it on the dataset (tab parameters)

    It will return a table value you can use in a query with an In() :

    ... SKU in (@TableValuedSKU)

    :w00t: !!!GOOGLE IS YOUR BEST FRIEND!!! :w00t:

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

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