IPrxSliceDimension.Selection

Syntax

Selection: IDimSelection;

Description

The Selection property returns dimension selection.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier. A data source is added to the report. A data slice is created for this source. At least one dimension of this slice is located in the fixed area.

Add links to the Dimensions, Matrix, Metabase, Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObjDes: IMetabaseObjectDescriptor;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
    Slices: IPrxSlices;
    Slice: IPrxSlice;
    SliceHeader: IPrxSliceHeader;
    SliceDim: IPrxSliceDimension;
Begin
    
// Get repository
    MB := MetabaseClass.Active;
    
// Get regular report
    MObjDes := MB.ItemById("REPORT");
    
// Open report for edit
    MObj := MObjDes.Edit;
    Report := MObj 
As IPrxReport;
    
// Get report data sources
    DtSources := Report.DataSources;
    
// Get the first data source
    DtSource := DtSources.Item(0);
    
// Get slices of the first data source
    Slices := DtSource.Slices;
    
// Get the first slice of the first data source
    Slice := Slices.Item(0);
    
// Get fixed dimensions of the first slice
    SliceHeader := Slice.FixedHeader;
    
// Get the first fixed dimension of the first slice
    SliceDim := SliceHeader.Item(0);
    
// Enable aggregation for elements of obtained dimension
    SliceDim.AggregationEnabled := TriState.OnOption;
    
// Select arithmetic mean as method of aggregation calculation
    SliceDim.AggregatorOperation := BasicAggregatorOperation.ArithmeticalMean;
    
// Add all dimension elements to selection
    SliceDim.Selection.SelectAll;
    
// Save changes in report
    MObj.Save;
End Sub UserProc;

Executing the example sets up parameters of the first dimension located in the fixed area of the data slice. Data aggregation is enabled for the dimension. Arithmetic mean is used as the aggregation method. All elements are added to selection.

See also:

IPrxSliceDimension