public final class HSSFSheetConditionalFormatting extends Object implements SheetConditionalFormatting
Modifier and Type | Method and Description |
---|---|
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1)
Add a new Conditional Formatting to the sheet.
|
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule[] cfRules)
Add a new Conditional Formatting set to the sheet.
|
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1,
ConditionalFormattingRule rule2)
Add a new Conditional Formatting consisting of two rules.
|
int |
addConditionalFormatting(CellRangeAddress[] regions,
HSSFConditionalFormattingRule rule1) |
int |
addConditionalFormatting(CellRangeAddress[] regions,
HSSFConditionalFormattingRule[] cfRules)
Allows to add a new Conditional Formatting set to the sheet.
|
int |
addConditionalFormatting(CellRangeAddress[] regions,
HSSFConditionalFormattingRule rule1,
HSSFConditionalFormattingRule rule2) |
int |
addConditionalFormatting(ConditionalFormatting cf)
Adds a copy of a ConditionalFormatting object to the sheet
|
int |
addConditionalFormatting(HSSFConditionalFormatting cf)
Adds a copy of HSSFConditionalFormatting object to the sheet
|
int |
addConditionalFormatting(Region[] regions,
HSSFConditionalFormattingRule[] cfRules)
Deprecated.
use CellRangeAddress instead of Region
|
HSSFConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
String formula1)
Create a conditional formatting rule that compares a cell value
to a formula calculated result, using an operator *
|
HSSFConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
String formula1,
String formula2)
A factory method allowing to create a conditional formatting rule
with a cell comparison operator
TODO - formulas containing cell references are currently not parsed properly
|
HSSFConditionalFormattingRule |
createConditionalFormattingRule(String formula)
A factory method allowing to create a conditional formatting rule with a formula.
The formatting rules are applied by Excel when the value of the formula not equal to 0. TODO - formulas containing cell references are currently not parsed properly |
HSSFConditionalFormatting |
getConditionalFormattingAt(int index)
gets Conditional Formatting object at a particular index
|
int |
getNumConditionalFormattings() |
void |
removeConditionalFormatting(int index)
removes a Conditional Formatting object by index
|
public HSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, String formula1, String formula2)
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- - a constant value from
CFRuleRecord.ComparisonOperator
:
formula1
- - formula for the valued, compared with the cellformula2
- - second formula (only used with
CFRuleRecord.ComparisonOperator.BETWEEN
) and
CFRuleRecord.ComparisonOperator.NOT_BETWEEN
operations)public HSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, String formula1)
SheetConditionalFormatting
The type of the created condition is ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- MUST be a constant value from
ComparisonOperator
except BETWEEN and NOT_BETWEENformula1
- the formula to determine if the conditional formatting is appliedpublic HSSFConditionalFormattingRule createConditionalFormattingRule(String formula)
createConditionalFormattingRule
in interface SheetConditionalFormatting
formula
- - formula for the valued, compared with the cellpublic int addConditionalFormatting(HSSFConditionalFormatting cf)
This method could be used to copy HSSFConditionalFormatting object from one sheet to another. For example:
HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);
cf
- HSSFConditionalFormatting objectpublic int addConditionalFormatting(ConditionalFormatting cf)
SheetConditionalFormatting
This method could be used to copy ConditionalFormatting object from one sheet to another. For example:
ConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);
addConditionalFormatting
in interface SheetConditionalFormatting
cf
- the Conditional Formatting to clonepublic int addConditionalFormatting(Region[] regions, HSSFConditionalFormattingRule[] cfRules)
public int addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule[] cfRules)
regions
- - list of rectangular regions to apply conditional formatting rulescfRules
- - set of up to three conditional formatting rulespublic int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulescfRules
- - set of up to three conditional formatting rulespublic int addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule rule1)
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulesrule1
- - the rule to applypublic int addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule rule1, HSSFConditionalFormattingRule rule2)
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulesrule1
- - the first rulerule2
- - the second rulepublic HSSFConditionalFormatting getConditionalFormattingAt(int index)
getConditionalFormattingAt
in interface SheetConditionalFormatting
index
- of the Conditional Formatting object to fetchpublic int getNumConditionalFormattings()
getNumConditionalFormattings
in interface SheetConditionalFormatting
public void removeConditionalFormatting(int index)
removeConditionalFormatting
in interface SheetConditionalFormatting
index
- of a Conditional Formatting object to removeCopyright © 2020. All rights reserved.