Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 带或条件的SSRS参数_Reporting Services_Ssrs 2008_Ssrs 2008 R2 - Fatal编程技术网

Reporting services 带或条件的SSRS参数

Reporting services 带或条件的SSRS参数,reporting-services,ssrs-2008,ssrs-2008-r2,Reporting Services,Ssrs 2008,Ssrs 2008 R2,我试图在SSRS中实现一个参数,条件是非此即彼。换句话说,my Branch参数应该能够搜索或查找任何分支或多个分支,或者将其保留为NULL或空白。同样,我的RepCode参数应该能够搜索或查找任何RepCode或多个RepCode,或者将其保留为NULL或空白 目前,我将分支设置作为必需设置,将repcode设置作为通配符搜索 我尝试过使用“允许多个值”,但如果不要求输入值,就无法使其正常工作。我希望能够在branch参数中输入值,或者留空,而在repcode参数中输入值并返回数据。我是否需

我试图在SSRS中实现一个参数,条件是非此即彼。换句话说,my Branch参数应该能够搜索或查找任何分支或多个分支,或者将其保留为NULL或空白。同样,我的RepCode参数应该能够搜索或查找任何RepCode或多个RepCode,或者将其保留为NULL或空白

目前,我将分支设置作为必需设置,将repcode设置作为通配符搜索

我尝试过使用“允许多个值”,但如果不要求输入值,就无法使其正常工作。我希望能够在branch参数中输入值,或者留空,而在repcode参数中输入值并返回数据。我是否需要
branch in(@branch)和repcode in(@repcode)
来实现此功能

如果将分支或repcode留空,则会出现以下错误

业务用户希望能够输入repcode并将分支保留为空,或者输入分支并将repcode保留为空,并且能够在两个参数中随意输入多个值

有没有办法在SSRS中做到这一点


谢谢,

使这些参数在SSR中为空

在SQL查询中,请使用此模式

WHERE (branch in (@branch) and (@branch is not null and @repcode is null))
  OR (repcode in (@repcode) and (@repcode is not null and @branch is null))
  OR (branch in (@repcode) and repcode in (@repcode) and (@branch is not null and @repcode is not null))