IEaxGridHeaderSettings.TotalStyle

Fore Syntax

TotalStyle: IEaxDataAreaCellStyle;

Fore.NET Syntax

TotalStyle: Prognoz.Platform.Interop.Express.IEaxDataAreaCellStyle;

Description

The TotalStyle property determines style for header totals.

Comments

To set up header placement, use the IEaxGridHeaderSettings.Placement property.

Fore Example

Executing the example requires that repository contains the EAX_HEADER_SETT express report including the totals by rows and by columns.

Add links to the Drawing, Express, Metabase, Pivot, Tab system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Eax: IEaxAnalyzer;
    Grid: IEaxGrid;
    Pivot: IPivot;
    PivotHeader: IPivotHeader;
    SettBase: IDataAreaHeaderSettingsBase;
    HeaderSettings: IEaxGridHeaderSettings;
    CellSt: IEaxDataAreaCellStyle;
    FormatConditions: ITabFormatConditions;
    FormatCondition: ITabFormatCondition;
    ValFormat: ITabFormatAverage;
    Style: ITabCellStyle;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get regular report
    Eax := mb.ItemById("EAX_HEADER_SETT").Edit As IEaxAnalyzer;
    // Get display settings of data table
    Pivot := Eax.Pivot;
    // Get table sidehead parameters
    PivotHeader := Pivot.LeftHeader;
    // Get report data table
    Grid := Eax.Grid;
    // Get header formatting parameters
    SettBase := PivotHeader As IDataAreaHeaderSettingsBase;
    HeaderSettings := Grid.ViewSettings.GetViewSettings(SettBase) As IEaxGridHeaderSettings;
    // Get formatting parameters of header totals
    CellSt := HeaderSettings.TotalStyle;
    // Create style and determine its parameters
    Style := New TabCellStyle.Create;
    Style.Font.Color := GxColor.FromName("Blue");
    // Create conditional formatting and set its parameters
    FormatConditions := New TabFormatConditions.Create;
    FormatCondition := FormatConditions.Add;
    FormatCondition.Type := TabConditionType.Average;
    ValFormat := FormatCondition.Details As ITabFormatAverage;
    ValFormat.Style := Style;
    ValFormat.Type := TabFormatAverageType.EqualAbove;
    // Determine that for header total formatting
    /// created style of conditional formatting will be applied
    CellSt.FormatConditions := FormatConditions;
    // Save report
    (Eax As IMetabaseObject).Save;
End Sub UserProc;

After executing the example conditional formatting is set for totals in table headers.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Tab;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Eax: IEaxAnalyzer;
    Grid: IEaxGrid;
    Pivot: IPivot;
    PivotHeader: IPivotHeader;
    SettBase: IDataAreaHeaderSettingsBase;
    HeaderSettings: IEaxGridHeaderSettings;
    CellSt: IEaxDataAreaCellStyle;
    FormatConditions: TabFormatConditions;
    FormatCondition: ITabFormatCondition;
    ValFormat: ITabFormatAverage;
    Style: TabCellStyle;
    Color: GxColorClassClass;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get regular report
    Eax := mb.ItemById["EAX_HEADER_SETT"].Edit() As IEaxAnalyzer;
    // Get display settings of data table
    Pivot := Eax.Pivot;
    // Get table sidehead parameters
    PivotHeader := Pivot.LeftHeader;
    // Get report data table
    Grid := Eax.Grid;
    // Get header formatting parameters
    SettBase := PivotHeader As IDataAreaHeaderSettingsBase;
    HeaderSettings := Grid.ViewSettings.GetViewSettings[SettBase] As IEaxGridHeaderSettings;
    // Get formatting parameters of header totals
    CellSt := HeaderSettings.TotalStyle;
    // Create style and determine its parameters
    Style := New TabCellStyle.Create();
    Color := New GxColorClassClass.Create();
    Style.Font.Color := Color.FromName("Blue");
    // Create conditional formatting and set its parameters
    FormatConditions := New TabFormatConditions.Create();
    FormatCondition := FormatConditions.Add();
    FormatCondition.Type := TabConditionType.tctAverage;
    ValFormat := FormatCondition.Details As ITabFormatAverage;
    ValFormat.Style := Style;
    ValFormat.Type := TabFormatAverageType.tfatAbove;
    // Determine that for header total formatting
    /// created style of conditional formatting will be applied
    CellSt.FormatConditions := FormatConditions;
    // Save report
    (Eax As IMetabaseObject).Save();
End Sub;

See also:

IEaxGridHeaderSettings