MapSetup Command

Purpose

Opens a standard dialog box that is used to set up parameters of the map located on one of the sheets of regular report.

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 this array contain the following values:

Value type Description
Element 1: IPrxMap The map, for which the parameter setup dialog box is to be displayed.
Element 2: IPrxReport The regular report, on a page of which a map is created.
Element 3: PrxAdapterDataType The type of data placement for adapter.
Optional element. If the element is not defined, dimensions and factors can be bound to the data in the sheets or to data slices.

Application Features

The command is used only for regular reports. Executing the command shows 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 a form with the Button1 button, the ReportBox component and the UiReport component named UiReport1, which is used as a data source for the ReportBox component. The active sheet of the regular report connected to the UiReport1 component contains a map with the PrxMap1 identifier.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Rep: IPrxReport;
    Map: IPrxMap;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    Data: Array;
Begin
    Rep := UiReport1.Instance As IPrxReport;
    Map := (Rep.ActiveSheet As IPrxTable).TabSheet.Objects.Object("PrxMap1"As IPrxMap;
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Data := New Variant[2];
    Data[0] := Map;
    Data[1] := Rep;
    Context.Data := Data;
    Target.Execute("MapSetup", Context);
End Sub Button1OnClick;

Clicking the button opens a standard dialog box that is used to set up map parameters. Layers and factors can be bound to the data in the sheets or to data slices.

Fore.NET Example

Executing the example requires a form, the Button1 button on the form, the ReportBoxNet component and the UiReportNet component named UiReportNet1, which is used as a data source for the ReportBoxNet component. The active sheet of the regular report contains a map with the PrxMap1 identifier.

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

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Rep: IPrxReport;
    Map: IPrxMap;
    WinApp: WinApplication = New WinApplicationClass_2();
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    Data: Array;
Begin
    Rep := UiReportNet1.ReportUi.Report;
    Map := (Rep.ActiveSheet As IPrxTable).TabSheet.Objects.Object["PrxMap1"As IPrxMap;
    Target := WinApp.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext();
    Data := New Object[2];
    Data[0] := Map;
    Data[1] := Rep;
    Context.Data := Data;
    Target.Execute("MapSetup", Context, Null);
End Sub;

Clicking the button opens a standard dialog box that is used to set up map parameters. Layers and factors can be bound to the data in the sheets or to data slices.

See also:

IUiCommandTarget.Execute