Modifier(LeftOperand: IDimSelection;
RightOperand: IDimSelection;
Operation: PivotTransformationSelectionOperation;
Modifier(LeftOperand: Prognoz.Platform.Interop.Dimensions.IDimSelection;
RightOperand: Prognoz.Platform.Interop.Dimensions.IDimSelection;
Operation: Prognoz.Platform.Interop.Express.PivotTransformationSelectionOperation;
LeftOperand. Left operand.
RightOperand. Right operand.
Operation. Operation of selection modification.
The Modifier method modifies dimension selection.
To check operation of selection modification, use IEaxDataAreaTransformation.TestModifier.
Executing the example requires that the repository contains express report with the EXPRESS identifier.
Add links to the Dimensions, Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
SS: IDimSelectionSet;
S: IDimSelection;
TypeSelOp: PivotTransformationSelectionOperation;
CalcTransformations: IEaxDataAreaTransformations;
CalcTransformation: IEaxDataAreaTransformation;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get data source slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item(0);
// Get formula of data transformation in analytical area
CalcTransformations := Slice.CalcTransformations;
CalcTransformation := CalcTransformations.Item(0);
// Get selection where formula is located and deselect it
SS := CalcTransformation.Selection;
S := SS.Item(0).CreateCopy;
S.DeselectAll;
S.CopyToEx(SelectionCopyToExOptions.WithGroup, ss.Item(0), True);
// Display to the console operation type of selection transformation in the table
TypeSelOp := CalcTransformation.ModifierOperation(SS.Item(0));
Select Case TypeSelOp.ToString
Case "0": Debug.WriteLine("Operation type - " + "None");
Case "1": Debug.WriteLine("Operation type - " + "Union");
Case "2": Debug.WriteLine("Operation type - " + "Intersection");
Case "3": Debug.WriteLine("Operation type - " + "Difference");
Case "4": Debug.WriteLine("Operation type - " + "Symmetric Difference");
Case "5": Debug.WriteLine("Operation type - " + "Replace");
End Select;
S := CalcTransformation.ModifierRightOperand(SS.Item(0));
CalcTransformation.Modifier(SS.Item(0), S, PivotTransformationSelectionOperation.Replace);
CalcTransformation.TestModifier(SS.Item(0), S);
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example:
Dimension selection will be modified.
Dimension selection modification will be checked.
Operation type of selection changing will be displayed to the console.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
DArea: IEaxDataArea;
Slice: IEaxDataAreaSlice;
SS: IDimSelectionSet;
S: IDimSelection;
TypeSelOp: PivotTransformationSelectionOperation;
CalcTransformations: IEaxDataAreaTransformations;
CalcTransformation: IEaxDataAreaTransformation;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
// Get data source slice
DArea := Express.DataArea;
Slice := DArea.Slices.Item[0];
// Get formula of data transformation in analytical area
CalcTransformations := Slice.CalcTransformations;
CalcTransformation := CalcTransformations.Item[0];
// Get selection where formula is located and deselect it
SS := CalcTransformation.Selection;
S := SS.Item[0].CreateCopy();
S.DeselectAll();
S.CopyToEx(SelectionCopyToExOptions.scteoWithGroup, ss.Item[0], True);
// Display to the console operation type of selection transformation in the table
TypeSelOp := CalcTransformation.ModifierOperation[SS.Item[0]];
Select Case TypeSelOp.ToString()
Case "0": System.Diagnostics.Debug.WriteLine("Operation type - " + "None");
Case "1": System.Diagnostics.Debug.WriteLine("Operation type - " + "Union");
Case "2": System.Diagnostics.Debug.WriteLine("Operation type - " + "Intersection");
Case "3": System.Diagnostics.Debug.WriteLine("Operation type - " + "Difference");
Case "4": System.Diagnostics.Debug.WriteLine("Operation type - " + "Symmetric Difference");
Case "5": System.Diagnostics.Debug.WriteLine("Operation type - " + "Replace");
End Select;
S := CalcTransformation.ModifierRightOperand[SS.Item[0]];
CalcTransformation.Modifier(SS.Item[0], S, PivotTransformationSelectionOperation.ptsoReplace);
CalcTransformation.TestModifier(SS.Item[0], Var S);
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: