How do I design alternate line colors for Project invoice?

Hi! I want to achieve something like this:


The lines should alternate background colours white/grey. Is there a way to do this in Docentric?

You can accomplish this by applying a visual format override to a tagging element, usually a field. The process is quite simple and there are many options you can implement. For example, the target can be the background of an entire table row or a single cell.

00 alternate line colors

After selecting the tagging element you want to conditionally format (1), click the Visual Format tile (2) and add a new override - the combination of Target, Format Property and Value (i.e. the condition you want to use for formatting).

The Xpath expression (4) I used here:
iif(current-index() mod 2 = 1, '#F6F6F6', 'white')

… basically says to divide the current index (e.g., the line number) by 2. If the remainder is equal to 1, the background of the cell should be grey (we used a HEX value for grey colour, #F6F6F6), otherwise it should be white.

You can also use other conditions, for example, the cell (background or text) should be coloured differently if the line amount exceeds a certain value. Text colour and/or font size can also be formatted in a similar way, and you can of course combine multiple visual format overrides on a single tagging element.

Here is an example:
PSAProjInvoice.Report_GREY.docx (122.9 KB)