ABCBottomStyle: ITabCellStyle;
The ABCBottomStyle property determines style of cells with minimum values of column or row on using the Top/Bottom analysis.
To determine cell style with maximum values of column or row, use the IEaxTableStyle.ABCTopStyle property.
Executing the example requires that the repository contains an express report with the EXPRESS_IPIVOTPARETOSETTENGSITEM identifier that contains a table.
Add links to the Drawing, Express, Metabase, Pivot, Tab system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
Pivot: IPivot;
ColumnSettings: IPivotParetoSettings;
BottomSettings: IPivotParetoSettingsItem;
TopSettings: IPivotParetoSettingsItem;
Grid: IEaxGrid;
Style: IEaxTableStyle;
AbcTopStyle: ITabCellStyle;
AbcBottomStyle: ITabCellStyle;
TopBrush: GxSolidBrush;
BottomBrush: GxSolidBrush;
TopColor: IGxColor;
BottomColor: IGxColor;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get express report
Analyzer := Metabase.ItemById("EXPRESS_IPIVOTPARETOSETTENGSITEM").Edit As IEaxAnalyzer;
// Get express report table
Pivot := Analyzer.Pivot;
// Apply 80/20 analysis to all columns
ColumnSettings := Pivot.Pareto.ColumnsSettings;
// Enable the analysis only for the first column
ColumnSettings.Enabled := True;
ColumnSettings.ElementIndex := 0;
// Get maximum values of the analyzed column
TopSettings := ColumnSettings.TopSettings;
// Change calculation type
TopSettings.Kind := PivotParetoKind.Count;
// Enable displaying of cells with maximum values
TopSettings.Display := True;
// Change the number of displayed cells with maximum values
TopSettings.Threshold := 2;
// Get minimum values of the analyzed column
BottomSettings := ColumnSettings.BottomSettings;
// Change calculation type
BottomSettings.Kind := PivotParetoKind.Count;
// Enable displaying of cells with minimum values
BottomSettings.Display := True;
// Change the number of displayed cells with minimum values
BottomSettings.Threshold := 2;
// Get report data table
Grid := Analyzer.Grid;
// Get table formatting parameters
Style := Grid.Style;
// Create and set green background color of cells with maximum values
AbcTopStyle := New TabCellStyle.Create;
TopColor := New GxColor.CreateRGB(0, 128, 0);
TopBrush := New GxSolidBrush.Create(TopColor);
AbcTopStyle.BackgroundBrush := TopBrush;
Style.ABCTopStyle := AbcTopStyle;
// Create and set red background color of cells with minimum values
AbcBottomStyle := New TabCellStyle.Create;
BottomColor := New GxColor.CreateRGB(255, 0, 0);
BottomBrush := New GxSolidBrush.Create(BottomColor);
AbcBottomStyle.BackgroundBrush := BottomBrush;
Style.ABCBottomStyle := AbcBottomStyle;
// Save changes
(Analyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the first column of express report table will be worked by the Top/Bottom analysis according to the set parameters:
Cells with maximum values are displayed.
Two cells with maximum values are displayed.
Cells with maximum values are filled with green color.
Cells with minimum values are filled with red color.
See also: