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 Formula2 | Define una regla estándar de comparación de celdas |
| Style | Formato diferencial diferido usado por reglas de celda y de expresión |
| DataBar, ColorScale and IconSet | Datos visuales para sus respectivos tipos de regla |
| Priority and StopIfTrue | Controlan el orden de las reglas de la hoja y el comportamiento de cortocircuito |
| Text, Rank, Percent, Bottom and AboveAverage | Parámetros de reglas de texto, superiores o inferiores y de promedio |
| TimePeriod | Intervalo 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