FormatConditions : IPrxFormatConditions;
FormatConditions : Prognoz.Platform.Interop.Report.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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Drawing;
...
Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
Prop: IPrxDataIslandProperties;
TabFormat : ITabFormatCondition;
ValFormat : ITabFormatValues;
Color : GxColorClass = New GxColorClassClass();
DI: IPrxDataIsland;
Begin
MB := Params.Metabase;
MObj := MB.ItemById["REPORT"].Edit();
DI := (MObj As IPrxReport).DataIslands.Item[0].Edit();
Prop := DI.Properties;
TabFormat := Prop.FormatConditions.Add();
TabFormat.Type := TabConditionType.tctValues;
ValFormat := TabFormat.Details As ITabFormatValues;
// Three-color gradient for cell formatting.
ValFormat.Style := TabFormatValuesStyle.tfvsThreeColorScale;
// Set minimum value.
ValFormat.MinValueType := TabFormatValueType.tfvtLowest;
ValFormat.MinValueColor := Color.FromName("Red");
// Set average value.
ValFormat.MidValueType := TabFormatValueType.tfvtPercent;
ValFormat.MidValue := 50;
ValFormat.MidValueColor := Color.FromName("Blue");
// Set maximum value.
ValFormat.MaxValueType := TabFormatValueType.tfvtHighest;
ValFormat.MaxValueColor := Color.FromName("Green");
DI.Save();
// Save report.
MObj.Save();
End Sub;
See also: