简体   繁体   中英

SSRS 2008 - Empty Textbox if condition is true

I've got a report which includes a column called Capacity and want to return "" if the result of the above textbox value is the same as the one in the current textbox.

Example;

Country      Capacity        Date
USA           100            01/01/2013
              100            08/01/2013
              100            15/01/2013
              100            22/01/2013

So in this case I would want to show the first row with the Capacity of 100 and the rest just blank rows as the capacity is the same, is there a way to do this in SSRS 2008 as I don't want to alter the SQL?

Thanks

You can use the PREVIOUS function (see doku ):

For the Textbox text use an expression to compare the current capacity value to the previous capacity value; if the values are the same display "" .

=IIF(Previous(Fields!FieldName.Value) <> Fields!FieldName.Value, 
     Fields!FieldName.Value, "")

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