491
Views
3
Comments
How to conditionally set  background colour of table cell?
Question
How to conditionally set background colour of table cell? Any ideas ?
2020-10-15 10-24-31
Miguel Seabra Melo
Dear Orlando,

For conditional formats we suggest the use of Extended Properties. In the case in hand, you would leave the Cell’s native “Style” property to “(none)” (as this kind of formatting is always unconditional), open the Extended Properties’ dialog for your required Cell and add a property style with a value similar to

FormatBoolean( boolean-expression, "background-color: #00ff00", "" )

In this particular case, if boolean-expression is true, the Cell’s background will be green, while if if boolean-expression is false, the background will be left unchanged (i.e. it will use the page or the table’s background colour).

Hope this helps.

Best regards,


Miguel
UserImage.jpg
Sandeep Kapil

Hi Miguel - Extended property is fine if there are only 2 colors but If there are 3 or 4 colors then what to do??

2017-07-05 22-17-18
Henrique Batista
Staff

Hi Sandeep,


You can add extra logic to that if condition but it would be confuse to use and manage.

On your case i would build an action with the function property set to yes so you can call it on the extended property. Something like:


So you would put something like:

"background-color = "+GetColorCell(MyParameter)


Let me know if it works.

Cheers,

Henrique

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.