ig.excel.ConditionalFormatCollection
Remarks
To enable a conditional format on a region of worksheet cells, add a ConditionBase-derived instance to this collection.
This collection exposes an Add method for each type of conditional format available.
For example, to add a conditional format which is based on a value and a logical operator, use the ConditionalFormatCollection.addOperatorCondition method.
The conditional formatting classes which derive from ConditionalFormatBase expose a CellFormat property, which in turn exposes properties which control the visual attributes of cells which meet the criteria defined by the condition. This format is applied to cells with a value which passes the condition.
Dependencies
-
addAverageCondition
- .addAverageCondition( regionAddress:string, [aboveBelow:ig.excel.FormatConditionAboveBelow] );
- Return Type:
- ig.excel.AverageConditionalFormat
- Return Type Description:
- The resulting AverageConditionalFormat.
Adds a new AverageConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- aboveBelow
- Type:ig.excel.FormatConditionAboveBelow
- Optional
- A FormatConditionAboveBelow value which defines the initial value of the AverageConditionalFormat.aboveBelow property. This parameter is optional and defaults to AboveAverage.
-
addBlanksCondition
- .addBlanksCondition( regionAddress:string );
- Return Type:
- ig.excel.BlanksConditionalFormat
- Return Type Description:
- The resulting BlanksConditionalFormat instance.
Adds a new BlanksConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
-
addColorScaleCondition
- .addColorScaleCondition( regionAddress:string, colorScaleType:ig.excel.ColorScaleType );
- Return Type:
- ig.excel.ColorScaleConditionalFormat
- Return Type Description:
- The resulting ColorScaleConditionalFormat instance.
Adds a new ColorScaleConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- colorScaleType
- Type:ig.excel.ColorScaleType
- A ColorScaleType value which determines whether to add a 2-color or 3-color scale.
Remarks
Note that when TwoColor is specified as the value of the colorScaleType parameter, the ColorScaleConditionalFormat.midpointThreshold property is not applicable; attempting to set properties on the object returned from that property causes an exception to be thrown.
The ColorScaleConditionalFormat.minimumThreshold and ColorScaleConditionalFormat.maximumThreshold properties can be used to customize the coloring and threshold boundaries for the minimum and maximum points of the associated range.
For a 3-color scale, the ColorScaleConditionalFormat.midpointThreshold can also be used to customize the midpoint threshold boundary.
-
addDataBarCondition
- .addDataBarCondition( regionAddress:string );
- Return Type:
- ig.excel.DataBarConditionalFormat
- Return Type Description:
- The resulting DataBarConditionalFormat instance.
Adds a new DataBarConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
See Also
-
addDateTimeCondition
- .addDateTimeCondition( regionAddress:string, [dateOperator:ig.excel.FormatConditionTimePeriod] );
- Return Type:
- ig.excel.DateTimeConditionalFormat
- Return Type Description:
- The resulting DateTimeConditionalFormat instance.
Adds a new DateTimeConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- dateOperator
- Type:ig.excel.FormatConditionTimePeriod
- Optional
- A FormatConditionTimePeriod which defines the time period against which cell date values are evaluated. This parameter is optional and defaults to Today.
-
addDuplicateCondition
- .addDuplicateCondition( regionAddress:string );
- Return Type:
- ig.excel.DuplicateConditionalFormat
- Return Type Description:
- The resulting DuplicateConditionalFormat instance.
Adds a new DuplicateConditionalFormat instance to this collection, configured as a duplicate value condition.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
Remarks
Use this method to add a condition which evaluates to true only for cell values which are non-unique across the associated range.
-
addErrorsCondition
- .addErrorsCondition( regionAddress:string );
- Return Type:
- ig.excel.ErrorsConditionalFormat
- Return Type Description:
- The resulting ErrorsConditionalFormat instance.
Adds a new ErrorsConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
-
addFormulaCondition
- .addFormulaCondition( regionAddress:string, formula:string, [cellReferenceMode:ig.excel.CellReferenceMode] );
- Return Type:
- ig.excel.FormulaConditionalFormat
- Return Type Description:
- The resulting FormulaConditionalFormat instance.
Adds a new FormulaConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- formula
- Type:string
- The formula which is used to determine whether a cell value meets the condition criteria.
- 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.
-
addIconSetCondition
- .addIconSetCondition( regionAddress:string, [iconSet:ig.excel.FormatConditionIconSet] );
- Return Type:
- ig.excel.IconSetConditionalFormat
- Return Type Description:
- The resulting IconSetConditionalFormat instance.
Adds a new IconSetConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- iconSet
- Type:ig.excel.FormatConditionIconSet
- Optional
- A FormatConditionIconSet value which identifies the icon set to use. This parameter is optional and defaults to IconSet3TrafficLights1.
Remarks
Each constant in the FormatConditionIconSet enumeration contains either 3, 4, or 5 in its name. This number identifies the number of thresholds supported by the condition.
A three-threshold condition supports thresholds of 33%, 67%, and 100%.
A four-threshold condition supports thresholds of 25%, 50%, 75%, and 100%.
A five-threshold condition supports thresholds of 20%, 40%, 60%, 80%, and 100%.
A ColorScaleCriterion object for each threshold, is returned from the IconSetConditionalFormat.iconCriteria collection.
These objects provide the ability to customize the values for the corresponding threshold. For example, the icon that is displayed for a given index can be overridden using the IconCriterion.icon property.
-
addNoBlanksCondition
- .addNoBlanksCondition( regionAddress:string );
- Return Type:
- ig.excel.NoBlanksConditionalFormat
- Return Type Description:
- The resulting NoBlanksConditionalFormat instance.
Adds a new NoBlanksConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
-
addNoErrorsCondition
- .addNoErrorsCondition( regionAddress:string );
- Return Type:
- ig.excel.NoErrorsConditionalFormat
- Return Type Description:
- The resulting NoErrorsConditionalFormat instance.
Adds a new NoErrorsConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
-
addOperatorCondition
- .addOperatorCondition( regionAddress:string, [conditionOperator:ig.excel.FormatConditionOperator] );
- Return Type:
- ig.excel.OperatorConditionalFormat
- Return Type Description:
- The resulting OperatorConditionalFormat instance.
Adds a new OperatorConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- conditionOperator
- Type:ig.excel.FormatConditionOperator
- Optional
- A FormatConditionOperator value which defines the initial value of the OperatorConditionalFormat.operator property. This parameter is optional and defaults to Equal.
-
addRankCondition
- .addRankCondition( regionAddress:string, [topBottom:ig.excel.FormatConditionTopBottom], [rank:number] );
- Return Type:
- ig.excel.RankConditionalFormat
- Return Type Description:
- The resulting RankConditionalFormat instance.
Adds a new RankConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- topBottom
- Type:ig.excel.FormatConditionTopBottom
- Optional
- A FormatConditionTopBottom value which determines whether the top or bottom of the ranking is evaluated. This parameter is optional and defaults to Top.
- rank
- Type:number
- Optional
- The numeric, percentage, or percentile ranking. This parameter is optional and defaults to 10.
Remarks
A RankConditionalFormat can be used, for example, to format the "top ten" values in a given cell range.
To change the number of top or bottom values, use the RankConditionalFormat.rank property.
-
addTextCondition
- .addTextCondition( regionAddress:string, [text:string], [textOperator:ig.excel.FormatConditionTextOperator] );
- Return Type:
- ig.excel.TextOperatorConditionalFormat
- Return Type Description:
- The resulting TextOperatorConditionalFormat instance.
Adds a new TextOperatorConditionalFormat instance to this collection.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
- text
- Type:string
- Optional
- A string which determines the string against which cell text values are evaluated. This parameter is optional and defaults to null.
- textOperator
- Type:ig.excel.FormatConditionTextOperator
- Optional
- A FormatConditionTextOperator value which determines the manner in which cell values are compared to the text value. This parameter is optional and defaults to BeginsWith.
-
addUniqueCondition
- .addUniqueCondition( regionAddress:string );
- Return Type:
- ig.excel.UniqueConditionalFormat
- Return Type Description:
- The resulting UniqueConditionalFormat instance.
Adds a new UniqueConditionalFormat instance to this collection, configured as a unique value condition.
- regionAddress
- Type:string
- A string identifying the region to which this conditional format applies.
Remarks
Use this method to add a condition which evaluates to true only for cell values which are unique across the associated range.
-
clear
- .clear( );
Removes all items from the collection.
-
contains
- .contains( condition:ig.excel.ConditionBase );
Returns true if the collection contains the condition
- condition
- Type:ig.excel.ConditionBase
- The condition
See Also
-
count
- .count( );
Returns the total number of items in the collection.
-
getEnumerator
- .getEnumerator( );
Returns an enumerator for the items in the collection.
-
indexOf
- .indexOf( condition:ig.excel.ConditionBase );
- Return Type:
- number
- Return Type Description:
- The index or -1 if the item is not in the collection
Gets the index of the item in the collection
- condition
- Type:ig.excel.ConditionBase
See Also
-
item
- .item( index:number );
- Return Type:
- ig.excel.ConditionBase
- Return Type Description:
- The item at the specified index
Indexer
- index
- Type:number
- The zer-based index of an item
Exceptions
Exception Description ig.IndexOutOfRangeException If the index is negative or greater than or equal to ConditionalFormatCollection.count See Also
-
remove
- .remove( condition:ig.excel.ConditionBase );
- Return Type:
- boolean
- Return Type Description:
- true is the item was removed or false if the item wasn't in the collection
Removes an item from the collection
- condition
- Type:ig.excel.ConditionBase
See Also
-
removeAt
- .removeAt( index:number );
Removes an item from the collection at a specifoed index
- index
- Type:number
- The zero based index in the collection