简体   繁体   English

ssrs过滤tablix表达式,它将使用参数值来过滤tablix

[英]ssrs filter tablix expression that will use parameter value to filter tablix

ssrs filter tablix expression that will use parameter value to filter tablix ssrs过滤tablix表达式,它将使用参数值来过滤tablix

Id like to filter my tablix based on one parameter with 3 possible values to select from. 我想根据一个带有3种可能值的参数过滤我的tablix。 Person Dog Both 人狗都

Then filter the tablix by field: Person, Dog, Both... 然后按字段过滤Tablix:人物,狗,两者...

---update -更新

Tablix Filter by parameter values. Tablix按参数值过滤。 Goal include ALL 目标包括全部

1 Parameter has 3 options (not multi select). 1参数具有3个选项(不是多选)。 PERSON, DOG, ALL. 人,狗,全部。

I have a field built called FILTER that places "ALL" in the cells. 我建立了一个名为FILTER的字段,该字段将“ ALL”放置在单元格中。

Otherwise its between the field CLIENT_TYPE "PERSON" or "DOG" 否则,其在CLIENT_TYPE字段“ PERSON”或“ DOG”之间

expression: Fields!CLIENT_TYPE.Value Value 表达式:Fields!CLIENT_TYPE.Value值
Parameters!CLIENT_TYPE.Value 参数!CLIENT_TYPE.Value

This works for "PERSON" and "DOG" only. 这仅适用于“ PERSON”和“ DOG”。 Dopes Not work for "ALL" 涂料不适用于“所有”

What would be the Expression and Value to filter the tablix according to parameter... 根据参数过滤tablix的表达式和值是什么...

could I trick the "ALL' into excluding nothing? 我可以欺骗“ ALL”排除一切吗?

expression IFF(Parameters!CLIENT_TYPE.Value = Fields!CLIENT_TYPE.Value or Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value , "include" , "Exclude") 表达式IFF(Parameters!CLIENT_TYPE.Value = Fields!CLIENT_TYPE.Value或Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value,“ include”,“ Exclude”)

Value =Parameters!CLIENT_TYPE.Value 值=参数!CLIENT_TYPE.Value

RESOLUTION: 解析度:

expression 表达

        =(Fields!CLIENT_TYPE.Value = Parameters!CLIENT_TYPE.Value) 
        OR
        (Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value)

value =true 值= true

you will click on your tablix properties -> visibility and then pop and expression like so iif(parameters_p1.value = 'Person',True,False). 您将单击tablix属性->可见性,然后像iif(parameters_p1.value ='Person',True,False)那样弹出和表达。 Keep in mind that if you have a select all option ie param can accept multiple values This solution WILL NOT WORK. 请记住,如果您具有全选选项,即param可以接受多个值,则此解决方案将无效。 It will only accept 1 value at a time and render result for that. 一次只能接受1个值并呈现结果。

You'll want to compare your field with the parameter. 您需要将您的字段与参数进行比较。

For a filter expression, you'd have something like 对于过滤器表达式,您将拥有类似

=IIF(Fields!YOUR_FIELD.Value = Parameters!YOUR_PARAMETER.Value OR Parameters!YOUR_PARAMETER.Value = "Both", 1, 0)

The set the type to integer and the value to 1. This will assign the value of 1 to records that your field matches the parameter or the parameter is both. 将类型设置为整数,将值设置为1。这将为您的字段与参数匹配或参数均为两者的记录分配值1。 This assumes that there are no other options however. 前提是没有其他选择。

You could also map the parameter to your query and filter the query instead of using a filter on the dataset or tablix. 您也可以将参数映射到查询并过滤查询,而不是在数据集或tablix上使用过滤器。

WHERE (YOUR_FIELD = @YOUR_PARAMETER or @YOUR_PARAMETER = 'Both') 

1 Parameter (3 options): Person, Dog, All... created a field in sproc: FILTER which holds "ALL" for every cell. 1参数(3个选项):Person,Dog,All ...在proc:FILTER中创建了一个字段,其中每个单元格都保留“ ALL”。

expression =(Fields!CLIENT_TYPE.Value = Parameters!CLIENT_TYPE.Value) OR (Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value) 表达式=(字段!CLIENT_TYPE.Value =参数!CLIENT_TYPE.Value)或(参数!CLIENT_TYPE.Value =字段!FILTER.Value)

value =true 值= true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM