IRubricatorAutoPeriodDate.Fixed

Fore Syntax

Fixed(Level: DimCalendarLevel, FirstDayOfWeek: DayOfWeekSet): DateTime;

Fore.NET Syntax

Fixed[Level: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel,
      FirstDayOfWeek: Prognoz.Platform.Interop.Dimensions.DayOfWeekSet]: System.DateTime;

Parameters

Level. Calendar level.

FirstDayOfWeek. First day of the week. It is actual for data with daily and weekly calendar frequencies.

Description

The Fixed method returns period date.

Comments

The property is relevant if IRubricatorAutoPeriodDate.IsFixed = True, that is, period date is set absolutely or relatively to the current date.

Fore Example

Executing the example requires a time series database with the FC_AUTO identifier that contains an export object with the OBJ_EXPORT identifier. Add links to the Metabase, Cubes and Dimensions system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubKey: Integer;
    Obj: IMetabaseObject;
    ExportRequestDef: IExportRequestDefinition;
    ExpParams: IExportRequestParams;
    ExpPeriod: IRubricatorAutoPeriod;
    ExpPeriodDate: IRubricatorAutoPeriodDate;
Begin
// Receive export object
    MB := MetabaseClass.Active;
    RubKey := MB.GetObjectKeyById("FC_AUTO");
    Obj := MB.ItemByIdNamespace("OBJ_EXPORT", RubKey).Bind;
    ExportRequestDef := Obj As IExportRequestDefinition;
// Edit export parameters
    ExpParams := ExportRequestDef.Exporter;
    ExpPeriod := ExpParams.AutoPeriod;
    ExpPeriodDate := ExpPeriod.Start;
    Debug.Write(Period start: );
    If ExpPeriodDate.IsFixed Then
        Debug.WriteLine(ExpPeriodDate.Fixed(DimCalendarLevel.Week, DayOfWeekSet.Monday));
    Else
        Debug.WriteLine(data start, );
        Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString);
    End If;
    ExpPeriodDate := ExpPeriod.End_;
    Debug.Write(Period end: );
    If ExpPeriodDate.IsFixed Then
        Debug.WriteLine(ExpPeriodDate.Fixed(DimCalendarLevel.Week, DayOfWeekSet.Monday));
    Else
        Debug.Write(data end, );
        Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString);
    End If;
End Sub UserProc;

After executing the example information on the time series export period start or end using the OBJ_EXPORT object is displayed in the console window.

Fore.NET Example

Executing the example requires a time series database with the FC_AUTO identifier that contains an export object with the OBJ_EXPORT identifier.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RubKey: uinteger;
    Obj: IMetabaseObject;
    ExportRequestDef: IExportRequestDefinition;
    ExpParams: IExportRequestParams;
    ExpPeriod: IRubricatorAutoPeriod;
    ExpPeriodDate: IRubricatorAutoPeriodDate;
Begin
// Receive export object
    MB := Params.Metabase;
    RubKey := MB.GetObjectKeyById("FC_AUTO");
    Obj := MB.ItemByIdNamespace["OBJ_EXPORT", RubKey].Bind();
    ExportRequestDef := Obj As IExportRequestDefinition;
// Edit export parameters
    ExpParams := ExportRequestDef.Exporter;
    ExpPeriod := ExpParams.AutoPeriod;
    ExpPeriodDate := ExpPeriod.Start;
    System.Diagnostics.Debug.Write(Period start: );
    If ExpPeriodDate.IsFixed Then
        System.Diagnostics.Debug.WriteLine(ExpPeriodDate.Fixed[DimCalendarLevel.dclWeek, DayOfWeekSet.dowsMonday]);
    Else
        System.Diagnostics.Debug.WriteLine(data start, );
        System.Diagnostics.Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString());
    End If;
    ExpPeriodDate := ExpPeriod.@End;
    System.Diagnostics.Debug.Write(Period end: );
    If ExpPeriodDate.IsFixed Then
        System.Diagnostics.Debug.WriteLine(ExpPeriodDate.Fixed[DimCalendarLevel.dclWeek, DayOfWeekSet.dowsMonday]);
    Else
        System.Diagnostics.Debug.Write(data end, );
        System.Diagnostics.Debug.WriteLine(shift:  + ExpPeriodDate.Offset.ToString());
    End If;
End Sub;

After executing the example information on the time series export period start or end using the OBJ_EXPORT object is displayed in the console window.

See also:

IRubricatorAutoPeriodDate