AdditionalObjects: ICubeMetaUpdateAdditionalObjects;
The AdditionalObjects property returns the collection of the objects, which must be copied with a time series database, but are not nested objects of this time series database.
The collection may include objects of different classes. If the user needs to copy a regular or express report, this report must be dependent only on one time series database.
Executing the example requires that the repository contains a folder with the TARGET_FOLDER identifier and an express report with the OBJ_REPORT identifier, which only data source is the time series database with the FC_FROM identifier. Also add links to the Cubes, Metabase and Rds system assemblies.
Sub UserSub
Var
Mb: IMetabase;
Update: ICubeMetaUpdateEx;
CreateInfo: IMetabaseObjectCreateInfo;
Parent: IMetabaseObjectDescriptor;
Rubr: IRubricator;
Report: IMetabaseObjectDescriptor;
AdditionalObjs: ICubeMetaUpdateAdditionalObjects;
AddObj: ICubeMetaUpdateAdditionalObject;
Begin
Mb := MetabaseClass.Active;
Parent := Mb.ItemById("TARGET_FOLDER");
Update := New CubeMetaUpdateClass.Create As ICubeMetaUpdateEx;
Update.Metabase := Mb;
Rubr := Mb.ItemById("FC_FROM").Bind As IRubricator;
Update.Rubricator := Rubr;
CreateInfo := Update.CreateInfo;
CreateInfo.Parent := Parent;
CreateInfo.Id := "RUBR_REPL";
CreateInfo.Name := "RUBR_REPL";
Update.RdsDatabase := Rubr.Database;
AdditionalObjs := Update.AdditionalObjects;
Report := Mb.ItemById("OBJ_REPORT");
AddObj := AdditionalObjs.Add(Report);
AddObj.TargetParent := Parent;
AddObj.TargetId := AddObj.SourceId + "_COPY";
Update.Apply(Null);
End Sub UserSub;
After executing the example the FC_FROM time series database is copied to the TARGET_FOLDER folder. The OBJ_REPORT report is copied to this folder together with the database. The report copy has the OBJ_REPORT_COPY identifier.
See also: