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
rangeXlsxCellRangeThe cells.
rankintHow many values, or what percent of them; 1 to 1,000.
percentboolWhether
rankis a percent.bottomboolWhether the lowest values are formatted.
formatXlsxDifferentialStyleWhat 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.