IEaxSyncGroups.CreateGroup

Syntax

CreateSyncGroup(SyncItem: IEaxDimensionDescriptor): IEaxSyncGroup;;

Parameters

SyncItem. Dimension description.

Description

The CreateGroup method creates a link of synchronized dimensions.

Comments

Link type depends on the type of the added dimension:

To set up synchronization of the required dimension, use the IEaxSyncItem.

Use IEaxSyncItem.Dimension:

To search for the synchronization element by selection/selected data, cast IEaxSyncItem.Dimension to the corresponding type IEaxPivotDimensionInstance/IEaxObjectDimensionInstance.

To remove the link of synchronized dimensions by its index, use IEaxSyncGroups.Remove.

Example

Executing the example requires that the repository contains a regular report with the REG_SYNCH identifier containing three analytical data areas based on the same source slices. The data source should contain a calendar dimension based on a calendar dictionary and the Countries dimension based on an MDM dictionary. These dimensions will be used to set up synchronization.

Add links to the Express, Metabase and Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    DataArea: IEaxDataArea;
    CountryDimKey: Integer;
    CalendarDimKey: Integer;
    // Synchronization groups
    SyncGroups: IEaxSyncGroups;
    // Slices
    Slices: IEaxDataAreaSlices;
    Slice1: IEaxDataAreaSlice;
    Slice2: IEaxDataAreaSlice;
    Slice3: IEaxDataAreaSlice;
    // Variables for setting up synchronization by selection for the Countries dimension
    Slice1_country_dim: IEaxPivotDimensionInstance;
    Slice2_country_dim: IEaxPivotDimensionInstance;
    PivotSelSyncGroup: IEaxSyncGroup;
    Slice2_SyncItem: IEaxSyncItem;
    // Variables for setting up synchronization by selected data for calendar dimension
    Slice2_calendar_dim: IEaxPivotDimensionInstance;
    Slice3_view: IEaxObject;
    Slice3_view_selection_manager: IEaxObjectSelectionManager;
    Slice3_calendar_dim: IEaxObjectDimensionInstance;
    Slice3_SyncItem: IEaxSyncItem;
    ObjectSelSyncGroup: IEaxSyncGroup;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get regular report
    Report := (MB.ItemById("REP_SYNCH").Edit As IPrxReport);
    // Get slices
    DataArea := Report.DataArea;
    Slices := DataArea.Slices;
    Slice1 := Slices.Item(0);
    Slice2 := Slices.Item(1);
    Slice3 := Slices.Item(2);
    // Set key of the Countries dimension - key of the MDM dictionary, on which the dimension is based
    CountryDimKey := 21216;
    // Set key of the Calendar dimension - key of the calendar dictionary, on which the dimension is based 
    CalendarDimKey := 21215
    
    // Synchronization by selection
    // Get dimension data to set up synchronization by selection
    Slice1_country_dim := Slice1.GetDimension(CountryDimKey) As IEaxPivotDimensionInstance;
    Slice2_country_dim := Slice2.GetDimension(CountryDimKey) As IEaxPivotDimensionInstance;
    // Create a synchronization by selection between the first and the second slices by the Countries dimension
    SyncGroups := Report.SyncGroups;
    PivotSelSyncGroup := SyncGroups.CreateGroup(Slice1_country_dim As IEaxDimensionDescriptor);
    Slice2_SyncItem := PivotSelSyncGroup.Add(Slice2_country_dim As IEaxDimensionDescriptor);
    // Set up two slices of the Input Only setting for the Countries dimension
    Slice2_SyncItem.SyncDirection := EaxDimensionSynchronizationDirection.ConsumeChangesOnly;
    
    // Synchronization by selected data
    Slice2_calendar_dim := Slice2.GetDimension(CalendarDimKey) As IEaxPivotDimensionInstance;
    Slice3_view := Slice3.Views.Item(0);
    Slice3_view_selection_manager := Slice3_view.SelectionManager;
    Slice3_calendar_dim := Slice3_view_selection_manager.GetDimension(CalendarDimKey) As IEaxObjectDimensionInstance;
    // Create a synchronization between the third and the second slices by the Calendar dimension
    ObjectSelSyncGroup := SyncGroups.CreateGroup(Slice2_calendar_dim As IEaxDimensionDescriptor);
    Slice3_SyncItem := ObjectSelSyncGroup.Add(Slice3_calendar_dim As IEaxDimensionDescriptor);
    // Save the obtained regular report
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the synchronization is set up:

See also:

IEaxSyncGroups