Opens a standard dialog box to set up parameters of the legend created for regular report charts.
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. |
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.
Executing the example requires a form with the Button1 button, the ReportBox component, and the UiReport component that is a data source for ReportBox. An active sheet of the regular report connected to the UiReport1 component contains a chart legend.
Add links to the Forms, Report, Tab, and UI system assemblies.
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: