ShowExportDialog Command

Purpose

Starts the wizard to start the current or create a new export object in the time series database.

Parameters of Use

Command parameters are passed in the Data property. To ensure command execution, specify one of the following values in the property:

Value type Description
IRubricatorInstance The time series database, to which a new export object is created.
IExportRequestInstance Export object to be started.

Application Features

Depending on the passed parameter type, a new export object is created or an existing export object is started. The command can be used for time series database only.

Example 1

Executing the example requires a form and a button named Button1 on it. The repository must contain a time series database created with the OBJ_RUBRICATOR identifier. An export object with the Export identifier is created in the database.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: IMetabase;
        Rub: IMetabaseObjectDescriptor;
        Export: IExportRequestInstance;
        CommandTarget: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        Rub := MB.ItemById("OBJ_RUBRICATOR");
        Export := MB.ItemByIdNamespace("Export", Rub.Key).Open(NullAs IExportRequestInstance;
        CommandTarget := WinApplication.Instance.GetPluginTarget("FactRubricator");
        Context := CommandTarget.CreateExecutionContext;
        Context.Data := Export;
        Context.ParentWindow := Self As IWin32Window;
        Context.Modal := True;
        CommandTarget.Execute("ShowExportDialog", Context);
    End Sub Button1OnClick;

Clicking the button opens a wizard to start the specified data export object in a time series database. The wizard dialog box opens modally relative to the current form.

Example 2

Executing the example requires a form and a button named Button1 on it. The repository must have a time series database created with the OBJ_RUBRICATOR identifier.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: IMetabase;
        RubInst: IRubricatorInstance;
        CommandTarget: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        RubInst := MB.ItemById("OBJ_RUBRICATOR").Open(NullAs IRubricatorInstance;
        CommandTarget := WinApplication.Instance.GetPluginTarget("FactRubricator");
        Context := CommandTarget.CreateExecutionContext;
        Context.Data := RubInst;
        Context.ParentWindow := Self As IWin32Window;
        Context.Modal := True;
        CommandTarget.Execute("ShowExportDialog", Context);
    End Sub Button1OnClick;

Clicking the button opens a wizard to create a new or to start the current data export object in a time series database. The wizard dialog box opens modally relative to the current form.

See also:

IUiCommandTarget.Execute