ig.excel.OperatorConditionalFormat
Dependencies
-
cellFormat
Inherited- .cellFormat( );
- Return Type:
- ig.excel.IWorksheetCellFormat
- Return Type Description:
- Returns a IWorksheetCellFormat.
Returns an IWorksheetCellFormat interface implementation which represents the format for cells which meet the criteria associated with this condition.
Remarks
The IWorksheetCellFormat implementation defines the visual attributes which are applied to cells whose value meets the associated condition.
See Also
-
conditionType
Inherited- .conditionType( );
- Return Type:
- ig.excel.FormatConditionType
- Return Type Description:
- Returns a FormatConditionType.
Returns a FormatConditionType value which identifies the type of condition for this instance.
See Also
-
operand1
- .operand1( );
- Return Type:
- ig.excel.Formula
- Return Type Description:
- Returns a Formula.
Returns the formula which defines the criteria for the first operand of this condition.
Remarks
This property is not directly settable; however, the following methods can be used to assign a formula:
- OperatorConditionalFormat.setOperand1
- OperatorConditionalFormat.setOperand1
- OperatorConditionalFormat.setOperand1
- OperatorConditionalFormat.setOperand1Formula
When the OperatorConditionalFormat.operator property is set to Between or NotBetween, this property defines the lower limit of the range for "between" comparisons.
Use the OperatorConditionalFormat.operand2 property to define the upper limit of the range for "between" comparisons.
-
operand2
- .operand2( );
- Return Type:
- ig.excel.Formula
- Return Type Description:
- Returns a Formula.
Returns a formula for the second operand which defines the criteria for this condition when the OperatorConditionalFormat.operator property is set to Between or NotBetween
Remarks
This property is only applicable when the OperatorConditionalFormat.operator property is set to Between or NotBetween.
Use this property to define the upper limit of the range for "between" comparisons, and the OperatorConditionalFormat.operand1 property to define the lower limit.
This property is not directly settable; however, the following methods can be used to assign a formula:
-
operator
- .operator( );
- Return Type:
- ig.excel.FormatConditionOperator
- Return Type Description:
- Returns a FormatConditionOperator.
Returns a FormatConditionOperator constant which determines the manner in which the cell value is compared against the OperatorConditionalFormat.operand1 property.
Remarks
This property determines how the cell value is compared to the OperatorConditionalFormat.operand1 property; for example, whether it is equal, greater than, less than, etc.
For the FormatConditionOperator values 'Between' and 'NotBetween', the OperatorConditionalFormat.operand2 property must also be set.
-
operator
- .operator( value:ig.excel.FormatConditionOperator );
- Return Type:
- ig.excel.FormatConditionOperator
- Return Type Description:
- Returns a FormatConditionOperator.
Returns a FormatConditionOperator constant which determines the manner in which the cell value is compared against the OperatorConditionalFormat.operand1 property.
- value
- Type:ig.excel.FormatConditionOperator
Remarks
This property determines how the cell value is compared to the OperatorConditionalFormat.operand1 property; for example, whether it is equal, greater than, less than, etc.
For the FormatConditionOperator values 'Between' and 'NotBetween', the OperatorConditionalFormat.operand2 property must also be set.
-
priority
Inherited- .priority( );
Returns a value which determines the order of evaluation when multiple conditional formatting rules exist.
Remarks
By default, conditions are evaluated in the order in which they appear within the containing collection.
This property makes it possible to weight one condition over another, essentially overriding the condition's ordinal position within the collection.
A lower number means a higher priority; for example, a condition with a priority of 1 is evaluated before one with a priority of 2.
If a cell value meets more than one condition, the format defined by the first condition to be evaluated takes precedence.
Setting the priority on one condition may cause the value of other conditions in the collection to be changed to ensure that each condition has a unique value.
-
priority
Inherited- .priority( value:number );
Sets a value which determines the order of evaluation when multiple conditional formatting rules exist.
- value
- Type:number
Remarks
By default, conditions are evaluated in the order in which they appear within the containing collection.
This property makes it possible to weight one condition over another, essentially overriding the condition's ordinal position within the collection.
A lower number means a higher priority; for example, a condition with a priority of 1 is evaluated before one with a priority of 2.
If a cell value meets more than one condition, the format defined by the first condition to be evaluated takes precedence.
Setting the priority on one condition may cause the value of other conditions in the collection to be changed to ensure that each condition has a unique value.
-
regions
Inherited- .regions( );
Returns the WorksheetRegion which identifies the cell range with which this condition is associated.
-
setFirstPriority
Inherited- .setFirstPriority( );
Sets the ConditionBase.priority value for this rule such that it is the first condition to be evaluated. Applicable only in the case where there is more than one element contained within the associated collection.
Remarks
When multiple conditions exist in the same collection, the order in which they are evaluated has bearing on which format is applied to cells which meet those conditions.
This method ensures that the associated condition is the first one to be evaluated.
To make a condition the last one to be evaluated, use the ConditionBase.setLastPriority method.
-
setLastPriority
Inherited- .setLastPriority( );
Sets the ConditionBase.priority value for this rule such that it is the last condition to be evaluated. Applicable only in the case where there is more than one element contained within the associated ConditionalFormatCollection.
Remarks
Just as the ConditionBase.setFirstPriority method ensures that the associated condition is evalulated first, the SetLastPriority method ensures that the associated condition is evaluated last.
Calling this method on more than one condition essentially replaces the previously designated condition as the last one to be evaluated with this one.
-
setOperand1
- .setOperand1( value:ig.Date );
Assigns the specified System.DateTime value to the OperatorConditionalFormat.operand1 property.
- value
- Type:ig.Date
- The System.DateTime value to assign.
-
setOperand1
- .setOperand1( value:number );
Assigns the specified System.Double value to the OperatorConditionalFormat.operand1 property.
- value
- Type:number
- The System.Double value to assign.
-
setOperand1
- .setOperand1( value:string );
Assigns the specified System.String value to the OperatorConditionalFormat.operand1 property.
- value
- Type:string
- The System.String value to assign.
-
setOperand1Formula
- .setOperand1Formula( formula:string, [cellReferenceMode:ig.excel.CellReferenceMode] );
Assigns a Formula to the OperatorConditionalFormat.operand1 property.
- formula
- Type:string
- The string representation of the Formula to be assigned to the OperatorConditionalFormat.operand1 property.
- cellReferenceMode
- Type:ig.excel.CellReferenceMode
- Optional
- A CellReferenceMode value which specifies whether the formula parameter should be interpreted as an A1 or R1C1 expression. This parameter is optional and defaults to null, in which case the Workbook.cellReferenceMode property is used.
Remarks
Note that the value of the formula parameter must begin with an equals sign (=).
-
setOperand2
- .setOperand2( value:ig.Date );
Assigns the specified System.DateTime value to the OperatorConditionalFormat.operand2 property.
- value
- Type:ig.Date
- The System.DateTime value to assign.
-
setOperand2
- .setOperand2( value:number );
Assigns the specified System.Double value to the OperatorConditionalFormat.operand2 property.
- value
- Type:number
- The System.Double value to assign.
-
setOperand2
- .setOperand2( value:string );
Assigns the specified System.String value to the OperatorConditionalFormat.operand2 property.
- value
- Type:string
- The System.String value to assign.
-
setOperand2Formula
- .setOperand2Formula( formula:string, [cellReferenceMode:ig.excel.CellReferenceMode] );
Assigns a Formula to the OperatorConditionalFormat.operand2 property.
- formula
- Type:string
- The string representation of the Formula to be assigned to the OperatorConditionalFormat.operand2 property.
- cellReferenceMode
- Type:ig.excel.CellReferenceMode
- Optional
- A CellReferenceMode value which specifies whether the formula parameter should be interpreted as an A1 or R1C1 expression. This parameter is optional and defaults to null, in which case the Workbook.cellReferenceMode property is used.
Remarks
Note that the value of the formula parameter must begin with an equals sign (=).
-
setRegions
Inherited- .setRegions( regionAddress:string, cellReferenceMode:ig.excel.CellReferenceMode );
Replaces the existing regions with new ones
- regionAddress
- Type:string
- A string with one or more comma separated region address
- cellReferenceMode
- Type:ig.excel.CellReferenceMode
- An optional cell reference mode
Exceptions
Exception Description ig.ArgumentException If regionAddress is invalid or contains a region from another worksheet -
stopIfTrue
Inherited- .stopIfTrue( );
Returns a boolean indicating whether additional formatting rules are evaluated if this rule evaluates to true. Applicable only in the case where the containing collection contains more than one element.
Remarks
If a cell value meets more than one condition, the format defined by the first condition takes precedence. Individual format properties are "merged" during the resolution process; for example, if one format has red borders and another has a red foreground color, a cell value which meets both conditions may be formatted with both red borders and a red foreground color.
This property makes it possible to short-circuit the resolution process, so that no other conditional formats are applied after the first condition evaluates to true.
Using the above example, assume StopIfTrue is set to a value of true on the conditional format with red borders, a second conditional format exists with a red foreground color, and a cell value meets both conditions. Because the StopIfTrue setting prevents additional formats from being evaluated, the cell will not show a red foreground color, whereas with StopIfTrue being set to false, it would show both red borders and a red foreground color.
In addition to preventing subsequent conditions from being evaluated, the order in which conditions are evaluated can be controlled using the ConditionBase.priority property.
-
stopIfTrue
Inherited- .stopIfTrue( value:boolean );
Sets a boolean indicating whether additional formatting rules are evaluated if this rule evaluates to true. Applicable only in the case where the containing collection contains more than one element.
- value
- Type:boolean
Remarks
If a cell value meets more than one condition, the format defined by the first condition takes precedence. Individual format properties are "merged" during the resolution process; for example, if one format has red borders and another has a red foreground color, a cell value which meets both conditions may be formatted with both red borders and a red foreground color.
This property makes it possible to short-circuit the resolution process, so that no other conditional formats are applied after the first condition evaluates to true.
Using the above example, assume StopIfTrue is set to a value of true on the conditional format with red borders, a second conditional format exists with a red foreground color, and a cell value meets both conditions. Because the StopIfTrue setting prevents additional formats from being evaluated, the cell will not show a red foreground color, whereas with StopIfTrue being set to false, it would show both red borders and a red foreground color.
In addition to preventing subsequent conditions from being evaluated, the order in which conditions are evaluated can be controlled using the ConditionBase.priority property.
-
workbook
Inherited- .workbook( );
- Return Type:
- ig.excel.Workbook
- Return Type Description:
- Returns a Workbook.
Returns a reference to the associated workbook.
See Also
-
worksheet
Inherited- .worksheet( );
- Return Type:
- ig.excel.Worksheet
- Return Type Description:
- Returns a Worksheet.
Returns a reference to the associated worksheet.
See Also