by
ru
en
by

Avemey

logo
FilesMainLinksPhotosAnime

Conditional formatting in ZEXMLSS

Warning: conditional formatting only for ODS!



Code examples

TZConditionalFormatting

Inherited from TPersistent. It is a container for conditional formatting on sheet.
Properties:
Property Short description
Count: integer; Count of conditional formatting
Items[Num: Integer]: TZConditionalStyle; Return conditional formatting Num.

Methods:
TZConditionalFormatting methods Short description
function function Add(): TZConditionalStyle; overload; Add new conditional formatting. Increments Count by 1.
function Add(Style: TZConditionalStyle): TZConditionalStyle; overload; Add new conditional formatting then copy all properties from Style. Increments Count by 1.
function Add(ColumnNum, RowNum, AreaWidth, AreaHeight: integer): TZConditionalStyle; overload; Add new conditional formatting. Set coordinates, width and height for conditional formatting area.
ColumnNum - column number
RowNum - row number
AreaWidth - area width
AreaHeight - area height
Increments Count by 1.
function Delete(num: integer): boolean; Delete condition formatting number num.
Return True if condition formatting was successfully removed. Decrements Count by 1.
procedure Clear(); Delete all condition formatting. Sets Count to 0.

TZConditionalStyle

Inherited from TPersistent. Condition formatting (style).
Properties:
Property Short description
Areas: TZConditionalAreas; Sheet area for applying conditional formatting.
Count: integer; Count of conditional formatting styles.
Items[Num: Integer]: TZConditionalStyleItem; Return conditional formatting style number Num.

Methods:
TZConditionalStyle method Short description
function function Add(): TZConditionalStyleItem; overload; Add new condition for condition formatting. Increments Count by 1.
function Add(StyleItem: TZConditionalStyleItem): TZConditionalStyleItem; overload; Add new condition for condition formatting then copy all properties from StyleItem. Increments Count by 1.
function Delete(num: integer): boolean; Delete condition for condition formatting number num.
Return True if successfully removed.
procedure Clear(); Delete all conditions for condition formatting.

TZConditionalStyleItem

Inherited form TPersistent. Condition formatting.
Properties:
Property Short description
ApplyStyleID: integer; Number of applying style
BaseCellColumnIndex: integer; Base cell column.
BaseCellRowIndex: integer; Base cell row.
BaseCellPageIndex: integer; Base cell sheet number. -1 - current sheet.
By default -1.
Condition: TZCondition; Condition.
By default ZCFCellContentOperator (cell value operator Value1).
ConditionOperator: TZConditionalOperator; Operator. Applied if Condition = ZCFCellContentOperator.
By default ZCFOpEqual (cell value = Value1).
Value1: String; Value1 for compares with cell value
Value2: String; Value1 for compares with cell value

Methods:
TZConditionalStyleItem methods Short description
procedure Clear(); Set default values:
  • ApplyStyleID := -1;
  • Condition := ZCFCellContentOperator;
  • ConditionOperator := ZCFOpEqual;
  • BaseCellPageIndex := -1;
  • BaseCellRowIndex := 0;
  • BaseCellColumnIndex := 0;
  • Value1 := '';
  • Value2 := '';

TZConditionalAreas

Inherited from TPersistent. Areas for applying conditional formatting.
Properties:
Property Short description
Count: integer; Count of areas.
Items[Num: Integer]: TZConditionalAreaItem; Return area number Num.

Methods:
TZConditionalAreas methods Short description
function Add(): TZConditionalAreaItem; overload; Add new area for applying conditional formatting. Increments Count by 1.
function Add(ColumnNum, RowNum, AreaWidth, AreaHeight: integer): TZConditionalAreaItem; overload; Add new area for applying conditional formatting. Sets coordinates, width and height.
ColumnNum - number of column starts area
RowNum - number of row starts area
AreaWidth - width of area
AreaHeight - height of area
Increments Count by 1.
procedure Delete(num: integer); Delete area num.
function IsCellInArea(ColumnNum, RowNum: integer): boolean; Return True if cell (ColumnNum, RowNum) in area.

TZConditionalAreaItem

Inherited from TPersistent. Single area for applying conditional formatting.
Properties:
Property Short description
Row: integer; Row of left top cell for applying conditional formatting.
Column: integer; Column of left top cell for applying conditional formatting.
Height: integer; Height of area.
Width: integer; Width of area.

Types:


Conditions
TZCondition = (ZCFIsTrueFormula, ZCFCellContentIsBetween, ZCFCellContentIsNotBetween, ZCFCellContentOperator, ZCFNumberValue, ZCFString, ZCFBoolTrue, ZCFBoolFalse, ZCFFormula, ZCFContainsText, ZCFNotContainsText, ZCFBeginsWithText, ZCFEndsWithText, ZCFCellIsEmpty, ZCFDuplicate, ZCFUnique, ZCFAboveAverage, ZCFBellowAverrage, ZCFAboveEqualAverage, ZCFBelowEqualAverage, ZCFTopElements, ZCFBottomElements, ZCFTopPercent, ZCFBottomPercent, ZCFIsError, ZCFIsNoError);

Value Description (condition applied if)
ZCFIsTrueFormula Formula Value1 returns True.
Formula example: "ISODD(COLUMN())" - conditional formatting applied for each odd column.
ZCFCellContentIsBetween Cell value between Value1 and Value2.
Limitations:
  • Cell type must be ZENumber!
  • Value1 and Value2 must converts to Float (delimitee "." or ",") or Int
ZCFCellContentIsNotBetween Cell value not between Value1 and Value2.
Limitations:
  • Cell type must be ZENumber!
  • Value1 and Value2 must converts to Float (delimitee "." or ",") or Int
ZCFCellContentOperator Cell value operator (more, less, equal ...) Value1
Limitations:
  • Cell type must be ZENumber!
  • Value1 and Value2 must converts to Float (delimitee "." or ",") or Int
ZCFNumberValue Not used
ZCFString Not used
ZCFBoolTrue Not used
ZCFBoolFalse Not used
ZCFFormula Not used
ZCFContainsText Cell value contains text Value1.
ZCFNotContainsText Cell value not contains text Value1.
ZCFBeginsWithText Cell value begins with text Value1.
ZCFEndsWithText Cell value ends with text Value1.
ZCFCellIsEmpty Cell is empty.
ZCFDuplicate Cells are duplicated.
ZCFUnique Cell has unique value .
ZCFAboveAverage Cell value is above average.
Cell type must be ZENumber!
ZCFBellowAverage Cell value is below average.
Cell type must be ZENumber!
ZCFAboveEqualAverage Cell value is above or equal average.
Cell type must be ZENumber!
ZCFBelowEqualAverage Cell value is below or equal average.
Cell type must be ZENumber!
ZCFTopElements First Value1 elements. (In LibreOffice Calc condition = "Top 10 elements")
Limitations:
  • Cell type must be ZENumber!
  • Value1 must converts to Int
ZCFBottomElements Bottom Value1 elements.
Limitations:
  • Cell type must be ZENumber!
  • Value1 must converts to Int
ZCFTopPercent Top Value1 percent.
Limitations:
  • Cell type must be ZENumber!
  • Value1 must converts to Int or Float
ZCFBottomPercent Bottom Value1 percent.
Limitations:
  • Cell type must be ZENumber!
  • Value1 must converts to Int or Float
ZCFIsError Cell has error.
ZCFIsNoError Cell has not error.

Operators:


TZConditionalOperator = (ZCFOpGT, ZCFOpLT, ZCFOpGTE, ZCFOpLTE, ZCFOpEqual, ZCFOpNotEqual);

Operator Description
ZCFOpGT > - Cell value is greater than Value1.
ZCFOpLT < - Cell value is less than Value1.
ZCFOpGTE >= - Cell value is greater or equal than Value1.
ZCFOpLTE <= - Cell value is less or equal than Value1.
ZCFOpEqual = - Cell value is equal Value1.
ZCFOpNotEqual <> - Cell value is not equal Value1.



FilesMainLinksPhotosAnime

Copyright © 2006-2012 Ruslan V. Neborak