Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Conditional Formatting – Colour Coding Numeric Values within a table.
I am trying to create a view that will highlight numeric values based on a rule:
If the number is < 0, RED
If the number is > 0 ,Black

I tried XHTML with the following code:
<span style=" <% If([STAFF COST DIF] < 0, "color:red", "color:green")%> ">
<% Left(ToText([STAFF COST DIF]), ".") %>
</span>

This converts the number to TEXT, now I have lost the digit grouping and Currency symbol and this display poorly.

Seeing that we have the option to select “Display in Bold”, can’t we also have an option to add conditional formatting rule?


ID
646
Category
Customization
Author

Gii Systems
Date Created
5/24/2013 8:14:30 AM
Date Updated
5/29/2013 2:31:00 PM
Status
New Idea
Score
10
Promoted By
Gii Systems
Comments
Slava Shinderov  Staff  5/24/2013 8:34:49 AM
@Jacques please try to use Format() function instead of ToText()

<span style=" <% If([STAFF COST DIF] < 0, "color:red", "color:green")%> ">
<% Format([STAFF COST DIF]) %>
</span>

or following simplified form:

<span style=" <% If([STAFF COST DIF] < 0, "color:red", "color:green")%> ">
<%= [STAFF COST DIF] %>
</span>

Gii Systems 5/24/2013 8:50:54 AM
Thanks Slava, much better.
Is there a way to do a "Justify Right"? It is still a bit messy to read as it is currency.
Slava Shinderov  Staff  5/24/2013 9:00:27 AM
@Jacques I guess no. Anyway Formula-XHTML allow you to colorize cell in "table" view only, it will not help with summary/crosstab view that you've on an attached screenshot.
martin oliver 5/29/2013 2:21:14 PM
Hi Slava,

Will color formatting work with summary columns?

Thanks

Martin
Slava Shinderov  Staff  5/29/2013 2:31:00 PM
@Martin if under summary columns you mean "Columns to calculate" section from summary/crosstab view then answer is no, otherwise Formula-XHTML column allows usage of any column in it.
Feedback
 
Back to Search Results