public class Top10
extends java.lang.Object
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 and Description |
|---|
Top10() |
| Modifier and Type | Method and Description |
|---|---|
int |
getRank()
Gets the value of "n" in a "top/bottom n" conditional formatting rule.
|
boolean |
isBottom()
Gets whether a "top/bottom n" rule is a "bottom n" rule.
|
boolean |
isPercent()
Gets whether a "top/bottom n" rule is a "top/bottom n percent" rule.
|
void |
setBottom(boolean value)
Sets whether a "top/bottom n" rule is a "bottom n" rule.
|
void |
setPercent(boolean value)
Sets whether a "top/bottom n" rule is a "top/bottom n percent" rule.
|
void |
setRank(int value)
Sets the value of "n" in a "top/bottom n" conditional formatting rule.
|
public boolean isPercent()
public void setPercent(boolean value)
public boolean isBottom()
public void setBottom(boolean value)
public int getRank()
public void setRank(int value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.