IsHierarchical: Boolean;
IsHierarchical: boolean;
The IsHierarchical property determines whether pop-up hierarchy is enabled.
Available values:
True. Pop-up hierarchy is enabled.
False. Pop-up hierarchy is disabled.
Executing the example requires a form that contains the Button component with the Button1 identifier and the UiReport component with the UiReport1 identifier. A regular report with a configured hierarchy is used as a data source. The example is a handler of the OnClick event for the Button1 component.
Add links to the Dimensions, ForeSystem, Matrix, Report system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Rep: IPrxReport;
DIs: IPrxDataIslands;
DI: IPrxDataIsland;
Dim: IDimInstance;
DimProp: IPrxDataIslandDimension;
Totals: IPrxDataIslandTotals;
TotalsL: IPrxDataIslandTotals;
DimModel: IDimensionModel;
DIProp: IPrxDataIslandProperties;
Top: IPrxDataIslandDimension;
Level: IPrxDataIslandLevel;
Begin
Rep := UiReport1.Report;
DIs := Rep.DataIslands;
DI := DIs.Item(0).Edit;
// Pop-up hierarchy:
DimModel := DI.Slice.TopHeader.Item(0).Dimension.Dimension;
DIProp := DI.Properties;
Top := DIProp.Dimension(DimModel);
Level := Top.Level(DimModel.Levels.Item(0));
If Not Level.IsHierarchical Then
Level.Hierarchical := TriState.OnOption;
End If;
Debug.WriteLine("Pop-up hierarchy: ");
Select Case Level.Hierarchical
Case TriState.OnOption:
Debug.WriteLine("is set");
Case TriState.OffOption:
Debug.WriteLine("is not set");
End Select;
Dim := DI.Slice.LeftHeader.Item(0).Dimension;
DimProp := DIProp.Dimension(Dim.Dimension);
// Parameters of totals by hierarchy
Totals := DimProp.HierarchyTotals;
Totals.Totals := TriState.OnOption;
Totals.Method := BasicAggregatorOperation.Sum;
// Parameters of totals by levels
TotalsL := DimProp.LevelTotals;
TotalsL.Totals := TriState.OnOption;
TotalsL.Method := BasicAggregatorOperation.Sum;
DI.Save;
End Sub Button1OnClick;
After executing the example the console window displays result of the checking if pop-up hierarchy is enabled for the set data area columns of regular report.
If the option is enabled, it will be disabled for the set area columns.
The regular report will contain configured totals by hierarchy and levels for the dimension located by in rows in the set data area.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Matrix;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Rep: IPrxReport;
DIs: IPrxDataIslands;
DI: IPrxDataIsland;
Dim: IDimInstance;
DimProp: IPrxDataIslandDimension;
Totals: IPrxDataIslandTotals;
TotalsL: IPrxDataIslandTotals;
DimModel: IDimensionModel;
DIProp: IPrxDataIslandProperties;
Top: IPrxDataIslandDimension;
Level: IPrxDataIslandLevel;
Begin
Rep := uiReportNet1.ReportUi.Report;
DIs := Rep.DataIslands;
DI := DIs.Item[0].Edit();
// Pop-up hierarchy:
DimModel := DI.Slice.TopHeader.Item[0].Dimension.Dimension;
DIProp := DI.Properties;
Top := DIProp.Dimension[DimModel];
Level := Top.Level[DimModel.Levels.Item[0]];
If Not Level.IsHierarchical Then
Level.Hierarchical := TriState.tsOnOption;
End If;
System.Diagnostics.Debug.WriteLine("Pop-up hierarchy: ");
Select Case Level.Hierarchical
Case TriState.tsOnOption:
System.Diagnostics.Debug.WriteLine("is set");
Case TriState.tsOffOption:
System.Diagnostics.Debug.WriteLine("is not set");
End Select;
Dim := DI.Slice.LeftHeader.Item[0].Dimension;
DimProp := DIProp.Dimension[Dim.Dimension];
// Parameters of totals by hierarchy
Totals := DimProp.HierarchyTotals;
Totals.Totals := TriState.tsOnOption;
Totals.Method := BasicAggregatorOperation.baoSum;
// Parameters of totals by levels
TotalsL := DimProp.LevelTotals;
TotalsL.Totals := TriState.tsOnOption;
TotalsL.Method := BasicAggregatorOperation.baoSum;
DI.Save();
End Sub;
See also: