java.lang.Object
com.aspose.cells.Top10
public class Top10
- extends java.lang.Object
Describe the Top10 conditional formatting rule.
This conditional formatting rule highlights cells whose
values fall in the top N or bottom N bracket, as specified.
Example:
//Instantiating a Workbook object
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().get(0);
//Adds an empty conditional formatting
int index = sheet.getConditionalFormattings().add();
FormatConditionCollection fcs = sheet.getConditionalFormattings().get(index);
//Sets the conditional format range.
CellArea ca = CellArea.createCellArea(0, 0, 10, 10);
fcs.addArea(ca);
//Adds condition.
int conditionIndex = fcs.addCondition(FormatConditionType.TOP_10, OperatorType.NONE, null, null);
//Sets the background color.
FormatCondition fc = fcs.get(conditionIndex);
fc.getStyle().setBackgroundColor(Color.getRed());
Top10 top10 = fc.getTop10();
//Set the Top N
top10.setRank(5);
//Saving the Excel file
workbook.save("output.xls");
|
Constructor Summary |
Top10()
|
|
Property Getters/Setters Summary |
boolean | isBottom() | |
void | setBottom(boolean) | |
|
Get or set whether a "top/bottom n" rule is a "bottom n" rule.
Default value is false.
|
boolean | isPercent() | |
void | setPercent(boolean) | |
|
Get or set whether a "top/bottom n" rule is a "top/bottom n percent" rule.
Default value is false.
|
int | getRank() | |
void | setRank(int) | |
|
Get or set the value of "n" in a "top/bottom n" conditional formatting rule.
If IsPercent is true, the value must between 0 and 100.
Otherwise it must between 0 and 1000.
Default value is 10.
|
Top10
public Top10()
-
|
Property Getters/Setters Detail |
isPercent/setPercent | |
public boolean isPercent() / public void setPercent(boolean value)
|
-
Get or set whether a "top/bottom n" rule is a "top/bottom n percent" rule.
Default value is false.
setPercent | |
public void setPercent(boolean value)
|
-
Get or set whether a "top/bottom n" rule is a "top/bottom n percent" rule.
Default value is false.
isBottom/setBottom | |
public boolean isBottom() / public void setBottom(boolean value)
|
-
Get or set whether a "top/bottom n" rule is a "bottom n" rule.
Default value is false.
setBottom | |
public void setBottom(boolean value)
|
-
Get or set whether a "top/bottom n" rule is a "bottom n" rule.
Default value is false.
getRank/setRank | |
public int getRank() / public void setRank(int value)
|
-
Get or set the value of "n" in a "top/bottom n" conditional formatting rule.
If IsPercent is true, the value must between 0 and 100.
Otherwise it must between 0 and 1000.
Default value is 10.
setRank | |
public void setRank(int value)
|
-
Get or set the value of "n" in a "top/bottom n" conditional formatting rule.
If IsPercent is true, the value must between 0 and 100.
Otherwise it must between 0 and 1000.
Default value is 10.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.