Wednesday, 18 November 2020

Colour Your Reports!

TrakIT can generate large reports of numbers and text. Sometime, looking for specific values or conditions is crucial. With the latest update of TrakIT, you can specify an expression to change the colour of a field based on the value of the field in an Advanced or Query Report.

The colour expression is a simple JavaScript expression that can be used to evaluate the colour based on the value of the field. The value if the field is specified as $VALUE$ (in caps). The colour can be any common HTML colour names (available here) or a hexadecimal colour code. You can look up hexadecimal colour codes here.


In the above example, we have a simple rule. If the weight of the container exceeds 10,000kg, it will appear as red. If not, it will appear blue.

Expressions can also match text values. For example:

$VALUE$=='Fail'?'red':'green'

If you need precise colours, you can use hexadecimal codes as follows:

$VALUE$==0?'#ffccaf':'#aabcef'

If you would like to change the background colour instead of the text colour just specify the prefix bg-

$VALUE$=='Confirmed'?'bg-green':'bg-#ffcccc'

You can specify multiple condition using brackets:

$VALUE$=='Stop'?'red':($VALUE$=='Look'?'yellow':'green')


The colour specified work only on Excel and HTML based reports. PDF support is coming soon. For any questions or clarifications, please write to TrakIT Support.