简体   繁体   中英

SSRS lookup condition after match values color

I have a lookup expression working with two dataset. The lookup is working, but am finding it difficult to fulfil certail condition. I want the condition to show green color if the totaldownload matches, but if not matches it should show red background. The code at the moment in lookup is

=Lookup(Cstr(Fields!register_number.Value) & Format(CDate(Fields!flight_date.Value), "yyyy-MM-dd"), Cstr(Fields!REG.Value) & Format(CDate(Fields!FL_DATE.Value),"yyyy-MM-dd"), Fields!TOTALDOWNLOAD.Value, "DataSetCountAIMS")

I tried to use this below in the properties of the table but still not working. Where should i put the code :

=SWITCH(Fields!totaldownload = Fields!Textbox10, "Green")   --- color properties  
=Switch(Fields!totaldownload <> Fields!Textbox10, "Red")    ----- background properties

Lets Say the text box where you do the look up is called " lookupvalue " (instead of some random text name like textbox1

Now you can do the color by doing this:

=iif(Reportitems!lookupvalue.value = Fields!textbox10.value,"Green","Red")

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