0
我正在处理SSRS中的报告项目。我有一个名为'客户'的参数。这个参数的值现在用sql查询填充。我想限制这个参数,使得用户应该能够选择一个客户或所有客户。不应该有任何可能性来选择2个或3个客户。选择SSRS 2008 R2中参数中的任一个或所有值
我正在处理SSRS中的报告项目。我有一个名为'客户'的参数。这个参数的值现在用sql查询填充。我想限制这个参数,使得用户应该能够选择一个客户或所有客户。不应该有任何可能性来选择2个或3个客户。选择SSRS 2008 R2中参数中的任一个或所有值
在参数列表中有一个名为All Customers
的选项,该选项是有序的,因此它位于参数列表的顶部。
如果您手动添加参数选项,则此顺序很简单。如果是数据驱动的,你可以在你的参数的数值数据做一个union all
以得到正确的次序:
select <Unique value that matches your customer ID type> as Value
,'All Customers' as Label
,1 as SortOrder
union all
select CustomerID as Value
,CustomerName as Label
,2 as SortOrder
from CustomerTable
order by SortOrder
,Label
,然后在你的查询,你只需要添加处理这个新All
值的逻辑:
select Columns
from Tables
where CustomerID = @Customer
or @Customer = <Unique value that matches your customer ID type>