AutoPeriod: IRubricatorAutoPeriod;
AutoPeriod: Prognoz.Platform.Interop.Cubes.IRubricatorAutoPeriod;
The AutoPeriod property returns parameters of time series export period.
The start and end of export period matches the start and end of data.
If export period is set relative to data start or end dates, data borders are determined based on value of the IExportRequestParams.AutoPeriod property:
CubeLoadClearMode.Default_. Data borders are determined by non-empty values for the VL observation attribute.
CubeLoadClearMode.MetadataOnly. Data borders are determined by non-empty attributes of observation level.
CubeLoadClearMode.DataOnly. Data borders are determined by non-empty point values.
CubeLoadClearMode.DataAndMetadata. Data borders are determined by non-empty attributes of observation level or by point value.
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 system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RubKey: Integer;
Obj: IMetabaseObject;
ExportRequestDef: IExportRequestDefinition;
ExpParams: IExportRequestParams;
ExpPeriod: IRubricatorAutoPeriod;
ExpPeriodDate: IRubricatorAutoPeriodDate;
ExportRequestInst: IExportRequestInstance;
Begin
// Receive export object
MB := MetabaseClass.Active;
RubKey := MB.GetObjectKeyById("FC_AUTO");
Obj := MB.ItemByIdNamespace("OBJ_EXPORT", RubKey).Edit;
ExportRequestDef := Obj As IExportRequestDefinition;
// Edit export parameters
ExpParams := ExportRequestDef.Exporter;
ExpPeriod := ExpParams.AutoPeriod;
ExpPeriodDate := ExpPeriod.Start;
ExpPeriodDate.AutoDateType := RubricatorAutoDateType.Exact;
ExpPeriodDate.ExactDate := DateTime.Parse("01.01.2000");
ExpPeriodDate := ExpPeriod.End_;
ExpPeriodDate.AutoDateType := RubricatorAutoDateType.Now;
ExpPeriodDate.Offset := -2;
Obj.Save;
// Export
ExportRequestInst := (ExportRequestDef As IMetabaseObjectDescriptor).Open(Null) As IExportRequestInstance;
ExportRequestInst.Export;
End Sub UserProc;
After executing the example factors are exported using the OBJ_EXPORT export object. Export periods are changed:
Period start: 01.01.2000.
Period end: the current date shifted to two points backward.
The requirements and result of Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
RubKey: uinteger;
Obj: IMetabaseObject;
ExportRequestDef: IExportRequestDefinition;
ExpParams: IExportRequestParams;
ExpPeriod: IRubricatorAutoPeriod;
ExpPeriodDate: IRubricatorAutoPeriodDate;
ExportRequestInst: IExportRequestInstance;
Begin
// Receive export object
MB := Params.Metabase;
RubKey := MB.GetObjectKeyById("FC_AUTO");
Obj := MB.ItemByIdNamespace["OBJ_EXPORT", RubKey].Edit();
ExportRequestDef := Obj As IExportRequestDefinition;
// Edit export parameters
ExpParams := ExportRequestDef.Exporter;
ExpPeriod := ExpParams.AutoPeriod;
ExpPeriodDate := ExpPeriod.Start;
ExpPeriodDate.AutoDateType := RubricatorAutoDateType.radtExact;
ExpPeriodDate.ExactDate := DateTime.Parse("01.01.2000");
ExpPeriodDate := ExpPeriod.@End;
ExpPeriodDate.AutoDateType := RubricatorAutoDateType.radtNow;
ExpPeriodDate.Offset := -2;
Obj.Save();
// Export
ExportRequestInst := (ExportRequestDef As IMetabaseObjectDescriptor).Open(Null) As IExportRequestInstance;
ExportRequestInst.Export();
End Sub;
See also: