IImportRequestProviderParams.AutoPeriod

Fore Syntax

AutoPeriod: IRubricatorAutoPeriod;

Fore.NET Syntax

AutoPeriod: Prognoz.Platform.Interop.Cubes.IRubricatorAutoPeriod;

Description

The AutoPeriod property returns parameters of factors import period.

Comments

By default, start and end of loading period matches with the start and end of data.

Fore Example

Executing the example requires that the repository contains a time series database with the FC_AUTO identifier. The database contains an import object with the OBJ_IMPORT identifier that imports data from all sources except for time series databases. Add links to the Metabase and Cubes system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    RubrDescr: IMetabaseObjectDescriptor;
    ImpRequestDefDescr: IMetabaseObjectDescriptor;
    ImpRequestDef: IImportRequestDefinition;
    ImpProvParams: IImportRequestProviderParams;
    ImpPeriod: IRubricatorAutoPeriod;
    ImpPeriodDate: IRubricatorAutoPeriodDate;
Begin
    Mb := MetabaseClass.Active;
    RubrDescr := Mb.ItemById("FC_AUTO");
    ImpRequestDefDescr := Mb.ItemByIdNamespace("OBJ_IMPORT", RubrDescr.Key);
    ImpRequestDef := ImpRequestDefDescr.Edit As IImportRequestDefinition;
    ImpProvParams := ImpRequestDef.ProviderParams;
    ImpPeriod := ImpProvParams.AutoPeriod;
    ImpPeriodDate := ImpPeriod.Start;
    ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateStart;
    ImpPeriodDate.Offset := 1;
    ImpPeriodDate := ImpPeriod.End_;
    ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateEnd;
    ImpPeriodDate.Offset := -1;
    ImpProvParams.IncreasePeriod := True;
    (ImpRequestDef As IMetabaseObject).Save;
End Sub UserProc;

After executing the example parameters of time series import period are changed:

Fore.NET Example

Executing the example requires that the repository contains a time series database with the FC_AUTO identifier. The database contains an import object with the OBJ_IMPORT identifier that imports data from all sources except for time series databases.

Imports Prognoz.Platform.Interop.Cubes;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    RubrDescr: IMetabaseObjectDescriptor;
    ImpRequestDefDescr: IMetabaseObjectDescriptor;
    ImpRequestDef: IImportRequestDefinition;
    ImpProvParams: IImportRequestProviderParams;
    ImpPeriod: IRubricatorAutoPeriod;
    ImpPeriodDate: IRubricatorAutoPeriodDate;
Begin
    Mb := Params.Metabase;
    RubrDescr := Mb.ItemById["FC_AUTO"];
    ImpRequestDefDescr := Mb.ItemByIdNamespace["OBJ_IMPORT", RubrDescr.Key];
    ImpRequestDef := ImpRequestDefDescr.Edit() As IImportRequestDefinition;
    ImpProvParams := ImpRequestDef.ProviderParams;
    ImpPeriod := ImpProvParams.AutoPeriod;
    ImpPeriodDate := ImpPeriod.Start;
    ImpPeriodDate.AutoDateType := RubricatorAutoDateType.radtDateStart;
    ImpPeriodDate.Offset := 1;
    ImpPeriodDate := ImpPeriod.@End;
    ImpPeriodDate.AutoDateType := RubricatorAutoDateType.radtDateEnd;
    ImpPeriodDate.Offset := -1;
    ImpProvParams.IncreasePeriod := True;
    (ImpRequestDef As IMetabaseObject).Save();
End Sub;

After executing the example parameters of factors import period are changed:

See also:

IImportRequestProviderParams