ConditionalFormattingIconCollection class
ConditionalFormattingIconCollection class
Represents a collection of ConditionalFormattingIcon
objects.
The ConditionalFormattingIconCollection type exposes the following members:
Properties
Property | Description |
---|---|
capacity | Gets or sets the number of elements that the array list can contain. |
Methods
Method | Description |
---|---|
add | Adds ConditionalFormattingIcon object. |
add | Adds ConditionalFormattingIcon object. |
copy_to | Copies the entire array list to a compatible one-dimensional array list, starting at the beginning of the target array list. |
copy_to | Copies a range of elements from the array list to a compatible one-dimensional array list, starting at the specified index of the target array list. |
index_of | Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that extends from the specified index to the last element. |
index_of | Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that starts at the specified index and contains the specified number of elements. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the entire array list. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that extends from the first element to the specified index. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that contains the specified number of elements and ends at the specified index. |
binary_search | Searches the entire sorted array list for an element using the default comparer and returns the zero-based index of the element. |
Example
from aspose.cells import CellArea, FormatConditionType, IconSetType, Workbook
# Instantiating a Workbook object
workbook = Workbook()
sheet = workbook.worksheets[0]
# Get Conditional Formatting
cformattings = sheet.conditional_formattings
# Adds an empty conditional formatting
index = cformattings.add()
# Get newly added Conditional formatting
fcs = cformattings[index]
# Sets the conditional format range.
ca = CellArea()
ca.start_row = 0
ca.end_row = 0
ca.start_column = 0
ca.end_column = 0
fcs.add_area(ca)
ca = CellArea()
ca.start_row = 1
ca.end_row = 1
ca.start_column = 1
ca.end_column = 1
fcs.add_area(ca)
# Sets condition
idx = fcs.add_condition(FormatConditionType.ICON_SET)
cond = fcs[idx]
# Sets condition's type
cond.icon_set.type = IconSetType.ARROWS_GRAY3
# Add custom iconset condition.
cfIcon = cond.icon_set.cf_icons[0]
cfIcon.type = IconSetType.ARROWS3
cfIcon.index = 0
cfIcon1 = cond.icon_set.cf_icons[1]
cfIcon1.type = IconSetType.ARROWS_GRAY3
cfIcon1.index = 1
cfIcon2 = cond.icon_set.cf_icons[2]
cfIcon2.type = IconSetType.BOXES5
cfIcon2.index = 2
# Saving the Excel file
workbook.save("output.xls")
See Also
- module
aspose.cells
- class
ConditionalFormattingIcon