Example:
# Instantiating a Workbook object workbook = Workbook() sheet = workbook.getWorksheets().get(0) # Adds an empty conditional formatting index = sheet.getConditionalFormattings().add() fcs = sheet.getConditionalFormattings().get(index) # Sets the conditional format range. ca = CellArea() ca.StartRow = 0 ca.EndRow = 2 ca.StartColumn = 0 ca.EndColumn = 0 fcs.addArea(ca) # Adds condition. idx = fcs.addCondition(FormatConditionType.ICON_SET) fcs.addArea(ca) cond = fcs.get(idx) # Get Icon Set iconSet = cond.getIconSet() # Set Icon Type iconSet.setType(IconSetType.ARROWS_3) # Put Cell Values cell1 = sheet.getCells().get("A1") cell1.putValue(10) cell2 = sheet.getCells().get("A2") cell2.putValue(120) cell3 = sheet.getCells().get("A3") cell3.putValue(260) # Saving the Excel file workbook.save("Book1.xlsx")
Property Getters/Setters Summary | ||
---|---|---|
method | getCfIcons() | |
Get the |
||
method | getCfvos() | |
Get the CFValueObjects instance.
|
||
method | isCustom() | |
Indicates whether the icon set is custom.
Default value is false.
|
||
method | getReverse() | |
method | setReverse(value) | |
Get or set the flag indicating whether to reverses the default order of the icons in this icon set. Default value is false. | ||
method | getShowValue() | |
method | setShowValue(value) | |
Get or set the flag indicating whether to show the values of the cells on which this icon set is applied. Default value is true. | ||
method | getType() | |
method | setType(value) | |
Get or Set the icon set type to display. Setting the type will auto check if the current Cfvos's count is accord with the new type. If not accord, old Cfvos will be cleaned and default Cfvos will be added. The value of the property is IconSetType integer constant. |
ConditionalFormattingIconCollection getCfIcons()
ConditionalFormattingValueCollection getCfvos()
int getType() / setType(value)
boolean isCustom()
boolean getShowValue() / setShowValue(value)
boolean getReverse() / setReverse(value)