Build(Selection: IDimSelection);
Selection. Selection in dimension.
The Build method adds elements corresponding to selected dimension elements to arbitrary layout.
Depending on values combinations of the PreserveDimensionElementsOrder and MergeWithSelection properties the Build method works as follows:
PreserveDimensionElementsOrder |
MergeWithSelection |
Build method effect |
False |
False |
None. |
False |
True |
Adds selection elements, missing in the arbitrary layout. |
True |
False |
Restores order for existing elements of the arbitrary layout. |
True |
True |
Restores order for existing elements of arbitrary layout, adding selection elements missing in the arbitrary layout. |
Executing the example requires a regular report with the REPORT identifier. This report must contain a data area containing a slice with dimension with the DIMENSION identifier.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
DataIsland: IPrxDataIsland;
DimS: IPrxSliceDimension;
Dim: IPrxDataIslandDimension;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("REPORT").Edit As IPrxReport;
DataIsland := Report.DataIslands.Item(0).Edit;
DimS := DataIsland.Slice.Dimensions.FindById("DIMENSION") As IPrxSliceDimension;
Dim := DataIsland.Properties.Dimension(DimS.Dimension.Dimension);
Dim.CustomLayout := True;
Dim.Layout.MergeWithSelection := True;
Dim.Layout.Build(DimS.Selection);
Dim.Layout.Save;
DataIsland.Save;
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example for a dimension with the DIMENSION identifier the arbitrary layout with adding all elements of the dimension selection is set up. After that the report with all changes is saved.
See also: