ChartExternLegendSetup

Purpose

Opens a standard dialog box to set up parameters of the legend created for regular report charts.

Parameters of Use

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

Value type Description
Element 1: IPrxReport A regular report, on a page of which a chart legend is created.
Element 2: IPrxChartLegend A chart, for which the parameter setting dialog box is to be displayed.

Application Features

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

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. An active sheet of the regular report connected to the UiReport1 component contains a chart legend.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Report: IPrxReport;
        Objs: ITabObjects;
        Obj: ITabObject;
        Target: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
        Data: Array;
        i: Integer;
    Begin
        Report := UiReport1.Report;
        Objs := (Report.ActiveSheet As IPrxTable).TabSheet.Objects;
        //Searches legend on regular report page
        For i := 0 To Objs.Count - 1 Do
            If Objs.Item(i).ClassId = "PrxChartLegend" Then
                Obj := Objs.Item(i);
                Break
            End If;
        End For;
        If Obj <> Null Then
            Target := WinApplication.Instance.GetPluginTarget("Report");
            Context := Target.CreateExecutionContext;
            Data := New Variant[2];
            Data[0] := Report;
            Data[1] := Obj As IPrxChartLegend;
            Context.Data := Data;
            Target.Execute("ChartExternLegendSetup", Context)
        End If;
    End Sub Button1OnClick;

Clicking the button opens a standard dialog box that is used to set up parameters of the legend found on the active sheet of the regular report connected in the UiReport1 component.

See also:

IUiCommandTarget.Execute