FormatConditions : IPrxFormatConditions;
The FormatConditions property determines conditional data formatting parameters.
Sub Main;
Var
Report: IPrxReport;
DI: IPrxDataIsland;
DimModel: IDimensionModel;
Prop: IPrxDataIslandProperties;
PropDim: IPrxDataIslandDimension;
Level: IPrxDataIslandLevel;
Style: IPrxDataElementStyle;
Format : IPrxFormatConditions;
TabFormat : ITabFormatCondition;
ValFormat : ITabFormatValues;
Begin
DI := Report.DataIslands.Item(0).Edit;
DimModel := DI.Slice.LeftHeader.Item(0).Dimension.Dimension;
Prop := DI.Properties;
PropDim := Prop.Dimension(DimModel);
Level := PropDim.Level(DimModel.Levels.Item(0));
Style := Level.Style;
Format := Style.FormatConditions;
TabFormat := Format.Add;
TabFormat.Type := TabConditionType.Values;
ValFormat := TabFormat.Details As ITabFormatValues;
//two-color gradient for cell formatting
ValFormat.Style := TabFormatValuesStyle.TwoColorScale;
//setting minimum value
ValFormat.MinValueType := TabFormatValueType.Lowest;
ValFormat.MinValueColor := GxColor.FromName("Red");
//setting maximum value
ValFormat.MaxValueType := TabFormatValueType.Highest;
ValFormat.MaxValueColor := GxColor.FromName("Blue");
DI.Save;
End Sub Main;
After executing the example conditional formatting is set for the level of the specified dimension located in rows.
See also: