ColCount: Integer;
ColCount: System.Int32;
The ColCount property sets the number of columns to be used for placing elements of the external legend.
To use the ColCount property, set the ItemPlacement property to ChartExtLegPlacement.CustomColumns.
The specified number of columns is always used regardless of the legend size. The number of rows is automatically calculated depending on the number of elements of the external legend and its size.
To execute this example, create a regular report with a chart and an external legend on the report sheet. A module is to be added to the report and the UserProc procedure is called from this module using the hyperlink. The inspector of module assemblies should contain links to the Chart, Report, Tab system assemblies.
Sub UserProc;
Var
ChartExLegend :IChartExternLegend;
Begin
ChartExLegend := (PrxReport.ActiveReport.ActiveSheet As IPrxTable).TabSheet.Objects.Item(1) As IChartExternLegend;
ChartExLegend.ItemPlacement := ChartExtLegPlacement.CustomColumns;
ChartExLegend.ColCount := 5;
End Sub UserProc;
After executing the example, five columns are used to display elements in the external legend.
To execute this example, create a regular report with a chart and an external legend on the report sheet. The .NET assembly is added to the report to handle report events. The OnBeforeOpenReport event is described in the module of the specified assembly in the EventsClass class. Add links to the Chart and Tab system assemblies.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Tab;
...
Public Override Sub OnBeforeOpenReport(Report:IPrxReport; Var Cancel:Boolean);
Var
ChartExLegend :IChartExternLegend;
Begin
Cancel := False;
ChartExLegend:=(Report.ActiveSheet As IPrxTable).TabSheet.Objects.Item[1] As IChartExternLegend;
ChartExLegend.ItemPlacement := ChartExtLegPlacement.celpCustomColumns;
ChartExLegend.ColCount := 5;
End Sub OnBeforeOpenReport;
Opening the report sets five columns to display elements in the external legend.
See also: