Menu
Download Free Trial
Table of contents

Conditional Format Object

Conditional format object describes conditional formatting rules. It has the following properties:

  • formula – IF statement with 3 arguments: IF(CONDITION, TRUE STYLE, FALSE STYLE), where the false style is optional. Condition can contain AND, OR, ==, !=, >, <, >=, <=, +, -, *, /, isNaN(), !isNaN(). #value is used to address the cell value in condition. Example: if(#value > 2, "trueStyle", "falseStyle").
  • trueStyle – style object that will be applied to a cell if the condition for the cell value is met. Please note that for export to Excel and PDF colors should be set as hex color codes.
  • falseStyle (optional) – style object. If it is set it will be applied to a cell if the condition for the cell value is not met.
  • id (optional) – id of the conditional formatting rule. If id property is not set, the id for the rule will be set inside Pivot component.
  • row (optional) – row index to which the condition should be applied.
  • column (optional) – column index to which the condition should be applied.
  • measure (optional) – measure unique name to which the condition should be applied.
  • hierarchy (optional) – hierarchy unique name to which the condition should be applied.
  • member (optional) – member unique name to which the condition should be applied.
  • isTotal (optional) – Boolean. If it is not defined, the condition will be applied to all cells. If it is true, the condition will be applied to totals and subtotals cells only. If it is false, the condition will be applied to regular cells only.

To add new conditional formatting rule use addCondition() API call.