Метод Table::getConditionalFormatRules
Метод позволяет получить коллекцию правил условного форматирования для текущего листа.
Вызов
public ConditionalFormatTableRules getConditionalFormatRules()
Возвращает
- коллекция правил условного форматирования для листа, тип ConditionalFormatTableRules.
Пример
Table sheet = document.getBlocks().getTable(0).get();
ConditionalFormatTableRules rules = sheet.getConditionalFormatRules();
auto topBottomStyle = ConditionalFormatCellStyle();
auto cellProperties = CellProperties();
cellProperties.fill = Fill(Color(ColorRGBA(255, 0, 0, 150)));
topBottomStyle.cellProperties = cellProperties;
CellRange cellRange = sheet.getCellRange("F2:F12");
auto cellRangePosition = cellRange.getTableRange();
auto topBottomOperator = createTopBottomConditionalFormatOperator(ConditionalFormatTopBottomCondition::Top, 20, true);
auto topBottomRule = ConditionalFormatRule(topBottomOperator, topBottomStyle, cellRangePosition, false);
rules.addRule(topBottomRule);