Cell Color

The cell color module allows us to set the background color of a cell depending on a value.

For example, let’s assume our data looks like this:

{
  "check0": "Yes",
  "check1": "No"
  "check2": "Maybe"
}

We want to display these values in a table and we want to set the background color of the cell green if the value is “Yes”, red if the value is “No” and blue for any other values.

We can configure our template like this:

When the report is generated it will look like this:

Note

When the system compares the value in the data to the <value>, case is ignored. So for example if the template <value> is “no” but the data value is “NO”, the color will still be applied.

Module Syntax

:cc <key> <value>:<color>[:<value>:<color>...][:<other>]

Explained:

:cc is the name of the module i.e. Cell Color

<value>:<color> is a value/color pair. Meaning, if the data matches the <value>, use this <color>. We can repeat as many as we want.

<other> is the color of the cell background if no values match

NOTE: the parts in the square brackets are optional.

Some examples:

Yes = green, No = red, any other value = blue

:cc check0 Yes:#00FF00:No:#FF0000:#0000FF

Yes = green, No = red

:cc check0 Yes:#00FF00:No:#FF0000

No = red

:cc check0 No:#FF0000