Documentación HotXLS

Clases TXLSXConditionalFormat y TXLSXConditionalFormats

TXLSXConditionalFormats es la colección de reglas expuesta por TXLSXWorksheet.ConditionalFormats y admite reglas de celda, visuales, de texto, de clasificación y de promedio

Métodos de la colección

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;

Miembros de la regla

Range, Op, Formula1 and Formula2Define una regla estándar de comparación de celdas
StyleFormato diferencial diferido usado por reglas de celda y de expresión
DataBar, ColorScale and IconSetDatos visuales para sus respectivos tipos de regla
Priority and StopIfTrueControlan el orden de las reglas de la hoja y el comportamiento de cortocircuito
Text, Rank, Percent, Bottom and AboveAverageParámetros de reglas de texto, superiores o inferiores y de promedio
TimePeriodIntervalo de fechas relativas para reglas de periodos de tiempo

Ejemplo

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;

Véase también