IPrxCalculatedPointDimensionShift.Shift

Fore Syntax

Shift: Integer;

Fore.NET Syntax

Shift: integer;

Description

The Shift property determines shift value.

Comments

To determine the level, by which shift is executed, use the IPrxCalculatedPointDimensionShift.Level property.

Fore Example

Executing the example requires that the repository contains a regular report with the DOCUMENT identifier that contains a text sheet. A data source of the regular report contains a dimension with the D_SEP identifier.

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

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DataSource: IPrxDataSource;
    SliceDims: IPrxSliceDimensions;
    Points: IPrxCalculatedPoints;
    Point, ParentPoint: IPrxCalculatedPoint;
    PointShift: IPrxCalculatedShiftedPoint;
    PointDimShift: IPrxCalculatedPointDimensionShift;
    Dim: IDimInstance;
    DimLevels: IDimLevelsInstance;
    DimLevel: IDimLevelInstance;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("DOCUMENT").Edit;
    Report := MObj As IPrxReport;
    DataSource := Report.DataSources.Item(0);
    SliceDims := DataSource.Slices.Item(0).Dimensions;
    Dim := SliceDims.FindById("D_SEP").Dimension;
    Points := DataSource.Points;
    Points.Clear;
    // Calculated point:
    Point := Points.Add;
    Point.Name := "Point_1";
    Point.CalculateValue;
    // Shift in calculated point:
    PointShift := Point As IPrxCalculatedShiftedPoint;
    ParentPoint := PointShift.ParentPoint;
    DimLevels:=Dim.Levels;
    DimLevel:=DimLevels.Item(DimLevels.Count-1);
    PointDimShift := PointShift.Shift(Dim);
    PointDimShift.Level := DimLevel;
    PointDimShift.Shift := 2;
    Debug.WriteLine("Dimension, by which shift is executed: "
        + PointDimShift.Dimension.Name);
    Points.CalculateValues;
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example:

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DataSource: IPrxDataSource;
    SliceDims: IPrxSliceDimensions;
    Points: IPrxCalculatedPoints;
    Point, ParentPoint: IPrxCalculatedPoint;
    PointShift: IPrxCalculatedShiftedPoint;
    PointDimShift: IPrxCalculatedPointDimensionShift;
    Dim: IDimInstance;
    DimLevels: IDimLevelsInstance;
    DimLevel: IDimLevelInstance;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["DOCUMENT"].Edit();
    Report := MObj As IPrxReport;
    DataSource := Report.DataSources.Item[0];
    SliceDims := DataSource.Slices.Item[0].Dimensions;
    Dim := SliceDims.FindById("D_SEP").Dimension;
    Points := DataSource.Points;
    Points.Clear();
    // Calculated point:
    Point := Points.Add();
    Point.Name := "Point_1";
    Point.CalculateValue(True);
    // Shift in calculated point:
    PointShift := Point As IPrxCalculatedShiftedPoint;
    ParentPoint := PointShift.ParentPoint;
    DimLevels:=Dim.Levels;
    DimLevel:=DimLevels.Item[DimLevels.Count-1];
    PointDimShift := PointShift.Shift[Dim];
    PointDimShift.Level := DimLevel;
    PointDimShift.Shift := 2;
    System.Diagnostics.Debug.WriteLine("Dimension, by which shift is executed: "
        + PointDimShift.Dimension.Name);
    Points.CalculateValues();
    (Report As IMetabaseObject).Save();
End Sub;

See also:

IPrxCalculatedPointDimensionShift