Bart Schelkens
Bart Schelkens

Reputation: 1293

SSRS Passing multi-select parameter to report

I have this report which gets data from a storedprocedure. I need to pass CustomerIDs from a multi-select dropdown to my report.

My storedprocedure looks like this :

@CustomerIds varchar(500)

select *
  FROM [Application].[ApplicationVersion] APPVERS 
 WHERE APPVERS.CustomerId IN ( @CustomerIds )

Can anyone help me?

Upvotes: 0

Views: 8249

Answers (1)

KidCode
KidCode

Reputation: 4221

The way I usually approach this is to use a filter.

  • Remove the where clause from your SQL Query.
  • Right click the dataset and select Properties > Filters.
  • Add.
  • Choose the field you want to filter on in the expression drop down. In your case, "CustomerId"
  • Choose 'In' as the operator.
  • Press the 'fx' on the value to create an expression, click parameters, then elect your parameter from the list. Make sure you remove '(0)' from the end, as this only takes the first selected value.

enter image description here

Upvotes: 9

Related Questions