InternalFormatConditions: ITabFormatConditions;
The InternalFormatConditions property returns a collection of conditional styles applied to cells of the table data area.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Expr: IEaxAnalyzer;
Grid: IEaxGrid;
GridStyle: IEaxTableStyle;
Conditions: ITabFormatConditions;
Condition: ITabFormatCondition;
ValFormat: ITabFormatAverage;
Style: ITabCellStyle;
Begin
//style for conditional format
Style := New TabCellStyle.Create;
Style.BackgroundColor := GxColor.FromName("Yellow");
MB := MetabaseClass.Active;
MObj := MB.ItemById("EXPRESS_REPORT").Edit;
Expr := MObj As IEaxAnalyzer;
Grid := Expr.Grid;
GridStyle := Grid.Style;
Conditions := GridStyle.InternalFormatConditions;
Condition := Conditions.Add;
Condition.Type := TabConditionType.Average;
ValFormat := Condition.Details As ITabFormatAverage;
ValFormat.Style := Style;
ValFormat.Type := TabFormatAverageType.EqualAbove;
MObj.Save;
End Sub Main;
After executing the example a conditional format for data area cells is added to the express report. The cells containing a value greater or equal to the mean value, have yellow backgound.
See also: