SSRS传递多选参数进行报告

Bar*_*ens 0 parameters multi-select reporting-services ssrs-2008-r2

我有这个报告从存储过程中获取数据.我需要将CustomerID从多选下拉列表传递到我的报告中.

我的storedprocedure看起来像这样:

@CustomerIds varchar(500)

select *
  FROM [Application].[ApplicationVersion] APPVERS 
 WHERE APPVERS.CustomerId IN ( @CustomerIds )
Run Code Online (Sandbox Code Playgroud)
  • 在我的报告中,我有参数"CustomerIds",数据类型设置为Integer(我尝试使用"TEXT",但它也不起作用).该参数设置为"允许多个值"

  • 在我的数据集定义的报告中,我将@CustomerIds定义如下:"= SPLIT(JOIN(参数!CustomerIds.Value,","),","))"(我只用SPLIT尝试过,仅JOIN并且它不起作用)

谁能帮我?

Kid*_*ode 7

我通常采用的方法是使用过滤器.

  • 从SQL查询中删除where子句.
  • 右键单击数据集并选择"属性">"过滤器".
  • 加.
  • 在表达式下拉列表中选择要筛选的字段.在您的情况下,"CustomerId"
  • 选择"In"作为运营商.
  • 按下值上的'fx'创建表达式,单击参数,然后从列表中选择参数.确保从末尾删除'(0)',因为这只取第一个选定的值.

在此输入图像描述