HotXLS ドキュメント

TXLSXConditionalFormat と TXLSXConditionalFormats クラス

TXLSXConditionalFormatsTXLSXWorksheet.ConditionalFormats が公開するルールコレクションで、セル、表示、文字、順位、平均のルールをサポートします

コレクションメソッド

function Add(const ARange: WideString; AOp: TXLSXCfOperator; const AFormula1: WideString): Integer;
function AddDataBar(const ARange: WideString; AColor: LongWord; AMinKind: TXLSCfValueKind; const AMinValue: WideString; AMaxKind: TXLSCfValueKind; const AMaxValue: WideString): Integer;
function AddColorScale2(...): Integer;
function AddColorScale3(...): Integer;
function AddIconSet(const ARange: WideString; ASetType: TXLSIconSetType): Integer;
function AddExpression(const ARange, AFormula: WideString): Integer;
function AddTextRule(const ARange: WideString; AKind: TXLSCfKind; const AText: WideString): Integer;
function AddTop10(const ARange: WideString; ARank: Integer; ABottom, APercent: Boolean): Integer;
function AddAboveAverage(const ARange: WideString; AAbove: Boolean): Integer;
function AddSimpleRule(const ARange: WideString; AKind: TXLSCfKind): Integer;

ルールメンバー

Range, Op, Formula1 and Formula2標準的なセル比較ルールを定義
Styleセルと式ルールで使う遅延差分書式
DataBar, ColorScale and IconSet各ルール種別の表示データ
Priority and StopIfTrueルール順序と短絡動作を制御
Text, Rank, Percent, Bottom and AboveAverage文字、上位または下位、平均ルールのパラメーター
TimePeriod期間ルールの相対日付範囲

var Index: Integer;
begin
  Index := Sheet.ConditionalFormats.AddExpression('B2:B100', 'B2<0');
  Sheet.ConditionalFormats[Index].Style.SetFillBgColor($0000FF);
  Sheet.ConditionalFormats.AddColorScale3('C2:C100', $0000FF, $00FFFF, $00FF00, cfvMinOfRange, '', cfvPercentile, '50', cfvMaxOfRange, '');
end;

関連項目