简体   繁体   中英

ssrs filter tablix expression that will use parameter value to filter tablix

ssrs filter tablix expression that will use parameter value to filter tablix

Id like to filter my tablix based on one parameter with 3 possible values to select from. Person Dog Both

Then filter the tablix by field: Person, Dog, Both...

---update

Tablix Filter by parameter values. Goal include ALL

1 Parameter has 3 options (not multi select). PERSON, DOG, ALL.

I have a field built called FILTER that places "ALL" in the cells.

Otherwise its between the field CLIENT_TYPE "PERSON" or "DOG"

expression: Fields!CLIENT_TYPE.Value Value
Parameters!CLIENT_TYPE.Value

This works for "PERSON" and "DOG" only. Dopes Not work for "ALL"

What would be the Expression and Value to filter the tablix according to parameter...

could I trick the "ALL' into excluding nothing?

expression IFF(Parameters!CLIENT_TYPE.Value = Fields!CLIENT_TYPE.Value or Parameters!CLIENT_TYPE.Value = Fields!FILTER.Value , "include" , "Exclude")

Value =Parameters!CLIENT_TYPE.Value

RESOLUTION:

expression

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

value =true

you will click on your tablix properties -> visibility and then pop and expression like so 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. It will only accept 1 value at a time and render result for that.

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. 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.

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.

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

value =true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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