ShowMapLayerSelectionDialog Command

Purpose

It opens a dialog box to select map structure.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify the following value in this property:

Value type Description
IPrxMap The map, for which the dialog box opens.

Application Features

The command can be used only for maps in regular reports. The result of command executing is the logical True if the OK button is clicked in the dialog, and the logical False if the Cancel button is clicked.

Fore Example

Executing the example requires a form containing the ReportBox component with the ReportBox1 identifier and the UiReport component with the UiReport1 identifier, which is a data source for ReportBox1. The regular report with map must be loaded in the UiReport1 component.

Add a link to the UI system assembly.

Sub UserProc;
Var
    Report: IPrxReport;
    Tab: ITabSheet;
    Map: IPrxMap;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    Report := UiReport1.Report;
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Map := Tab.Objects.Item(0).Extension As IPrxMap;
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Context.Data := Map;
    Target.Execute("ShowMapLayerSelectionDialog", Context);
End Sub UserProc;

After executing the example the dialog box opens that is used to select map structure.

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.Tab;
Imports Prognoz.Platform.Interop.Ui;

Public Sub UserProc();
Var
    Report: IPrxReport;
    Tab: ITabSheet;
    Map: IPrxMap;
    WinApp: WinApplication = New WinApplicationClass_2();
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    Report := uiReportNet1.ReportUi.Report;
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Map := Tab.Objects.Item[0].Extension As IPrxMap;
    Target := WinApp.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext();
    Context.Data := Map;
    Target.Execute("ShowMapLayerSelectionDialog", Context, Null);
End Sub UserProc;

See also:

IUiCommandTarget.Execute