Settings(Value: IDimHierarchyInstance): IEaxHierarchySettings;
Value. Alternative hierarchy.
The Settings property determines settings of the specified alternative hierarchy.
To create settings, use the EaxHierarchySettings class.
Executing the example requires that a repository contains an express report with the EAX_DIMPROP identifier containing custom alternative hierarchy.
Add links to the Dimension, Express, Metabase, Pivot, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Grid: IEaxGrid;
Pivot: IPivot;
PvtHeader: IPivotHeader;
PvtDim: IPivotDimension;
ViewSettings: IEaxGridViewSettings;
HeaderProp: IEaxGridHeaderProperties;
DimProp: IEaxDimensionProperties;
Hier: IEaxDataAreaHierarchy;
Sett: IEaxHierarchySettings;
DimSel: IDimSelection;
DimEl: String;
CellStyle: IEaxDataAreaCellStyle;
Begin
// Get current repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EAX_DIMPROP").Edit As IEaxAnalyzer;
// Get report data table
Grid := Express.Grid;
// Get display parameters of report data table
ViewSettings := Grid.ViewSettings;
// Get object basing on which data table is built
Pivot := Grid.Pivot;
// Get table sidehead
PvtHeader := Pivot.LeftHeader;
// Get the first dimension in the sidehead
PvtDim := PvtHeader.PivotDim(0);
// Get display settings of the first dimension in the sidehead
HeaderProp := ViewSettings.GetViewSettings(PvtDim As IDataAreaHeaderSettingsBase);
DimProp := HeaderProp As IEaxDimensionProperties;
// Get alternative hierarchy
Hier := Express.DataArea.Hierarchies.Item(0);
// Get settings of alternative hierarchy
Sett := DimProp.Settings(Hier.Hierarchy);
// Change header alignment for the first element of alternative hierarchy
DimSel := PvtDim.DimInstance.CreateSelection;
DimSel.SelectAll;
DimEl := DimSel.Dimension.Elements.Id(DimSel.Element(0));
CellStyle := Sett.CellStyle(DimEl);
CellStyle.Header.HorizontalAlignment := TabFormatAlignment.Center;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example header formatting is changed for the first element of alternative hierarchy.
See also: