Using Visual Format Override

Visual format override – as its name suggests – allows overriding the default visual format settings. Let’s see this in action on the example of the Sales invoice.

Change the text color

We want to display the tax amount in red if it is larger than 100.

Step by step explanation:

  1. First we select the tagging element where we want to override the default visual formatting.
  2. Next we click the Visual Format button in the Properties of our tagging element.
  3. Click the plus button to add new visual format override.
  4. Select the visual format override properties as desired. In our case we’ve used the following:
    • Target: This Table Cell only
    • Format Property: Text Color
    • Value: iif(SalesInvoiceHeaderExt/Amounts/@SumTax > 100, 'red', 'black')

Resulting document will now have the tax amount displayed in red if it is greater than 100.

We can see which elements in the Element Tree have their visual format override set. Those elements can be recognized by round rainbow icons in the Element Tree pane and by one or more icons in the Properties pane of the tagging element, which show what kind of visual format is applied.

Hide an entire table column

Now we want to hide the Total discount column if the total discount field value is zero.

We first select one field tagging element in the column which we want to conditionally hide and then we click on the Visual Format button. Again we add the new visual format:

This time we select This Table Column as the Target. The visual format will apply on the whole column in this table. We select Visible in the Format Property drop-down list. This property expects a Boolean value, so we enter the following expression: SalesInvoiceHeaderExt/Amounts/@EndDisc > 0

As a result, the Total discount column is no longer visible when we run the report.

All possible Visible Format overrides

Below is the table with all possible Visible Format combinations which can be applied in the same manner as explained on the two examples in this manual.

Target Format Property Expression return value type
Whole Table, Whole Table Row, This Table Cell Only Text Color String: color name
Bold Boolean
Italic Boolean
Underline Boolean
Font Size Integer: font size in px
Background color String: color name
This Table Column Visible Boolean

See also

Using the If Tagging Element >>

IN THIS ARTICLE