Key : Integer;
The Key property returns a unique key of an element.
The following example assumes that there is the Report object with the IPrxReport type.
Sub UserProc;
Var
Report: IPrxReport;
DIs: IPrxDataIslands;
DI: IPrxDataIsland;
Prop: IPrxDataIslandProperties;
Dim : IDimInstance;
DimProp : IPrxDataIslandDimension;
RN : IPrxDataIslandDimensionLayoutNodes;
Element, Child : IPrxDataIslandDimensionLayoutNode;
i : Integer;
Begin
DIs := Report.DataIslands;
DI := DIs.Item(0).Edit;
Prop := DI.Properties;
Dim := DI.Slice.LeftHeader.Item(0).Dimension;
DimProp := Prop.Dimension(Dim.Dimension);
DimProp.CustomLayout := True;
RN := DimProp.Layout.RootNodes;
Element := RN.Add;
Element.DimElement(Dim) := 1;
Element.Caption := Dim.Elements.Name(1);
For i := 2 To 19 Do
Child := Element.Children.Add;
Child.Caption := Dim.Elements.Name(i);
Child.DimElement(Dim) := i;
End For;
For i := 0 To RN.Item(0).Children.Count - 1 Do
Debug.WriteLine(RN.Item(0).Children.Item(i).Key);
End For;
DI.Save;
End Sub UserProc;
After executing the example the console window displays keys of created child elements of the heading.
See also: