简体   繁体   中英

SSRS 2008 - Filter Expression at Tablix Properties

I wrote the query and did not set up the "where clause" because I would like to have all values returned.

I set up the filter at the Tablix properties and allowed the users to select them as parameters.

I also set up a parameter to filter the result as well. Let's say that parameter's name is "p_location".

What I would like to do:

  1. If the user does not select anything in the parameter box, or parameter box is blank, return everything. Another word, do not filter anything.

  2. If the user types something in the parameters, filter that parameter against a field name.

I wrote this in the expression and it does not seem to work:

= IIF(IsNothing(Parameters!p_Location.Value),"",Fields!Location.Value)

Then, I select LIKE to be my operator

Then, the value box = Parameters!p_location.value

The user will type the search using the % at the end in order to obtain the result.


Is it possible to set up with the word "ALL" in this parameter box to return everything? If I set it up this way, the filtering might not work because it contains some value, instead of blank.


Thanks in advance.

When using the tablix filter, you need to use * as a wild card. In parameters, set the default value to *.

  1. It is necessary to choose the properties for the parameters: "allow null", it is crucial.

  2. You need to choose the default value of "null"


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