ShowPrxControlPropDialog Command

Purpose

Opens a dialog box that is used to set up properties of a control.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify an array of the Variant type in this property, the elements of the array contain the following values:

Value type Description
Element 1: IPrxReport The regular report, for which it is required to show the dialog box for setting up properties of a control.
Element 2: IPrxControl The control, which properties are required to be displayed.

Application Features

The command is used only for regular reports. Executing the command shows logical True if the OK button is clicked in the dialog box, and False if the Cancel button is clicked.

Fore Example

Executing the example requires the following components: a form, the Button1 button on the form, the ReportBox component and the UiReport component named UiReport1, which is used as a data source for the ReportBox component. The regular report linked to the UiReport1 component contains at least one control.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Report: IPrxReport;
    Control: IPrxControl;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    Data: Array;
Begin
    Report := UiReport1.Instance As IPrxReport;
    Control := Report.Controls.Item(0);
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Data := New Variant[2];
    Data[0] := Report;
    Data[1] := Control;
    Context.Data := Data;
    Target.Execute("ShowPrxControlPropDialog", Context);
End Sub Button1OnClick;

Clicking the button opens the dialog box for setting up properties of the first control.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Ui;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Report: IPrxReport;
    Control: IPrxControl;
    WinApp: WinApplication = New WinApplicationClass_2();
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    Data: Array;
Begin
    Report := UiReportNet1.ReportUi.Report;
    Control := Report.Controls.Item[0];
    Target := WinApp.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext();
    Data := New Object[2];
    Data[0] := Report;
    Data[1] := Control;
    Context.Data := Data;
    Target.Execute("ShowPrxControlPropDialog", Context, Null);
End Sub;

See also:

IUiCommandTarget.Execute