HierarchySettings: IEaxHierarchySettings;
HierarchySettings: Prognoz.Platform.Interop.Express.EaxHierarchySettings;
The HierarchySettings property determines alternative hierarchy settings.
To create settings, use the EaxHierarchySettings class.
Executing the example requires that a repository contains express report with the EXPRESS_HIE identifier containing custom alternative hierarchy.
Add links to the Dimensions, Express, Metabase, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Hier: IEaxDataAreaHierarchy;
HierSett: IEaxHierarchySettings;
DimSel: IDimSelection;
DimEl: String;
CellStyle: IEaxDataAreaCellStyle;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS_HIE").Edit As IEaxAnalyzer;
// Get alternative hierarchy
Hier := Express.DataArea.Hierarchies.Item(0);
// Create settings of alternative hierarchy
HierSett := New EaxHierarchySettings.Create;
Hier.HierarchySettings := HierSett;
// Change header alignment for the first element of alternative hierarchy
DimSel := Hier.Selection;
DimSel.SelectAll;
DimEl := DimSel.Dimension.Elements.Id(DimSel.Element(0));
CellStyle := New EaxDataAreaCellStyle.Create;
CellStyle.Header.HorizontalAlignment := TabFormatAlignment.Center;
HierSett.CellStyle(DimEl) := CellStyle;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example header formatting is changed for the first element of alternative hierarchy.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Hier: IEaxDataAreaHierarchy;
HierSett: EaxHierarchySettings;
DimSel: IDimSelection;
DimEl: String;
CellStyle: EaxDataAreaCellStyle;
Begin
// Get current repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS_HIE"].Edit() As IEaxAnalyzer;
// Get alternative hierarchy
Hier := Express.DataArea.Hierarchies.Item[0];
// Create settings of alternative hierarchy
HierSett := New EaxHierarchySettings.Create();
Hier.HierarchySettings := HierSett;
// Change header alignment for the first element of alternative hierarchy
DimSel := Hier.Selection;
DimSel.SelectAll();
DimEl := DimSel.Dimension.Elements.Id[DimSel.Element[0]];
CellStyle := New EaxDataAreaCellStyle.Create();
CellStyle.Header.HorizontalAlignment := TabFormatAlignment.tfaCenter;
HierSett.CellStyle[DimEl] := CellStyle;
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: