NamedRangesSetup Command

Purpose

It opens a dialog box that is used to set up named ranges.

Parameters of Use

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

Value type Description
ITabSheet The page containing a cell range.
Array The array of the Variant type that contains the following components:
Element 1: ITabSheet. The page containing a cell range.
Element 2: ITabRange. The cell range, for which the dialog box that is used to set up named ranges, opens.

Application Features

The command can be used only for regular reports.

Example

Executing the example requires 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.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Report: IPrxReport;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    Report := UiReport1.Instance As IPrxReport;
    Target := WinApplication.Instance.GetPluginTarget("Report");
    Context := Target.CreateExecutionContext;
    Context.Data := (Report.ActiveSheet As IPrxTable).TabSheet;
    Target.Execute("NamedRangesSetup", Context);
End Sub Button1OnClick;

Clicking the button opens the dialog box that is used to set up named ranges.

See also:

IUiCommandTarget.Execute