ICubeMetaCopier.DestinationRubricator

Syntax

DestinationRubricator: IRubricator;

Description

The DestinationRubricator property determines a consumer database.

Example

Executing the example requires time series databases with the OBJ_RUBRICATOR and OBJ_RUBRICATOR_SOUR identifiers. The databases must contain time series attributes COUNTRY and INDICATOR.

Sub Main;

Var

MB: IMetabase;

Copier: ICubeMetaCopier;

Bindings: ICubeMetaCopierBindings;

Binding: ICubeMetaCopierBinding;

Log: ICubeMetaLoaderLog;

LogEnt: ICubeMetaLoaderLogEntry;

i: Integer;

Begin

MB := MetabaseClass.Active;

Copier := New CubeMetaCopierClass.Create;

 

// Copy parameters

Copier.CalendarLevelSet := DimCalendarLevelSet.Year;

Copier.DestinationRubricator := MB.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;

Copier.SourceRubricator := MB.ItemById("OBJ_RUBRICATOR_SOUR").Bind As IRubricator;

Copier.ImportObjectKey := MB.ItemById("OBJ_RUBRICATOR").Key;

Copier.NewRevisionName := Indicators copying;

Bindings := Copier.Bindings;

 

Binding := Bindings.Add;

Binding.BindingType := CubeMetaCopierBindingType.Attribute;

Binding.DestinationAttribute := "COUNTRY";

Binding.SourceAttribute := "COUNTRY";

 

Binding := Bindings.Add;

Binding.BindingType := CubeMetaCopierBindingType.Const_;

Binding.DestinationAttribute := "INDICATOR";

Binding.SourceAttribute := "INDICATOR";

Binding.Value := 1009;

 

// Indicators copying and report displaying

Copier.Copy;

Log := Copier.Log;

For i := 0 To Log.Count - 1 Do

LogEnt := Log.Item(i);

Debug.WriteLine("Record number: " + LogEnt.RecordNumber.ToString);

Debug.WriteLine("Date of record creation: " + LogEnt.DateBegin.ToString);

Debug.WriteLine("Field: " + LogEnt.Field);

If LogEnt.IsWarning Then

Debug.WriteLine("Warning: " + LogEnt.ErrorMessage);

End If;

If LogEnt.IsError Then

Debug.WriteLine("Error: " + LogEnt.ErrorMessage);

Debug.WriteLine("Error code: " + LogEnt.ErrorCode.ToString);

End If;

Debug.WriteLine("----");

End For;

End Sub Main;

After executing the example time series of the OBJ_RUBRICATOR_SOUR database are copied to the OBJ_RUBRICATOR database. The console window displays the report about the results of copying.

See also:

ICubeMetaCopier