IAdhocReport.CopyFrom

Syntax

CopyFrom(pSource: IAdhocReport);

Parameters

pSource. The dashboard to be copied.

Description

The CopyFrom method copies parameters of the specified dashboard to the current dashboard.

Comments

The pSource parameter cannot be set to Null.

Example

Executing the example requires that the repository contains a dashboard with the DASHBOARD_EXPORT identifier.

Add links to the Adhoc, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MObjSrc, MOdjDest: IMetabaseObject;
    DashboardSrc, DashboardDest: IAdhocReport;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := MetabaseClass.Active;
    // Get a dashboard to be copied
    MObjSrc := MB.ItemById("DASHBOARD_EXPORT").Bind;
    DashboardSrc := MObjSrc As IAdhocReport;
    // Create a new dashboard
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_ADHOC_REPORT;
    CrInfo.Id := MB.GenerateId("DASHBOARD");
    CrInfo.Name := "Dashboard";
    CrInfo.Parent := MObjSrc.Parent;
    MOdjDest := MB.CreateObject(CrInfo).Edit;
    DashboardDest := MOdjDest As IAdhocReport;
    // Copy all dashboard parameters
    // DASHBOARD_EXPORT to the new dashboard
    DashboardDest.CopyFrom(DashboardSrc);
    // Save changes
    MOdjDest.Save;
End Sub UserProc;

After executing the example a new dashboard is created. All parameters of the created dashboard will be copied from the DASHBOARD_EXPORT dashboard.

See also:

IAdhocReport