FormatConditions : IPrxFormatConditions;
The FormatConditions property determines parameters of conditional data formatting.
Executing the example requires a regular report with the REPORT identifier, which contains data area. Add links to the Metabase, Report, Drawing, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Prop: IPrxDataIslandProperties;
TabFormat : ITabFormatCondition;
ValFormat : ITabFormatValues;
DI: IPrxDataIsland;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("REPORT").Edit;
DI := (MObj As IPrxReport).DataIslands.Item[0].Edit;
Prop := DI.Properties;
TabFormat := Prop.FormatConditions.Add;
TabFormat.Type := TabConditionType.Values;
ValFormat := TabFormat.Details As ITabFormatValues;
// Three-color gradient for cell formatting.
ValFormat.Style := TabFormatValuesStyle.ThreeColorScale;
// Set minimum value.
ValFormat.MinValueType := TabFormatValueType.Lowest;
ValFormat.MinValueColor := GxColor.FromName("Red");
// Set average value.
ValFormat.MidValueType := TabFormatValueType.Percent;
ValFormat.MidValue := 50;
ValFormat.MidValueColor := GxColor.FromName("Blue");
// Set maximum value.
ValFormat.MaxValueType := TabFormatValueType.Highest;
ValFormat.MaxValueColor := GxColor.FromName("Green");
DI.Save;
// Save report.
MObj.Save;
End Sub UserProc;
After executing the example conditional formatting of the cells is set on the basis of their values: style: three-color gradient.
See also: