Table of Contents

Method AddTopBottom

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

AddTopBottom(XlsxCellRange, int, bool, bool, XlsxDifferentialStyle)

Adds a rule that formats the highest or the lowest values (Excel's Top/Bottom Rules).

public XlsxConditionalFormat AddTopBottom(XlsxCellRange range, int rank, bool percent, bool bottom, XlsxDifferentialStyle format)

Parameters

range XlsxCellRange

The cells.

rank int

How many values, or what percent of them; 1 to 1,000.

percent bool

Whether rank is a percent.

bottom bool

Whether the lowest values are formatted.

format XlsxDifferentialStyle

What the rule changes.

Returns

XlsxConditionalFormat

The rule.

Exceptions

ArgumentOutOfRangeException

The rank is outside 1 to 1,000 (or 100 for a percent).

ArgumentException

The format sets nothing.

InvalidOperationException

The sheet is not a worksheet.