Legends: IVZLegends;
Legends: Prognoz.Platform.Interop.Visualizators.VZLegends;
The Legends property returns a collection of table legends.
To determine metric purpose in visualizer legend, use IEaxObject.IndicatorLegendAssignment.
Executing the example requires that the repository contains form with the following components:
ReportBox with the ReportBox1 identifier.
UiReport with the UiReport1 identifier which is a data source for ReportBox1.
Regular report containing the table is required. One of table dimensions has the Background color metric type. Regular report is a data source for UiReport1.
Add links to the Drawing, Express, Tab, Visualizators system assemblies.
Sub UserProc;
Var
Report: IPrxReport;
TS: ITabSheet;
Grid: IEaxGrid;
Pos: IGxRectF;
Visualizer: IPrxVisualizerLegend;
i: Integer;
Begin
// Get regular report
Report := UiReport1.Report;
// Get active report sheet
TS := (Report.ActiveSheet As IPrxTable) As ITabSheet;
// Insert table legend in the report
Pos := New GxRectF.Create(0, 0, 0, 0);
Pos.Left := TS.View.Selection.Range.Location.X;
Pos.Top := TS.View.Selection.Range.Location.Y;
Pos.Width := TS.View.Selection.Range.Width;
Pos.Height := TS.View.Selection.Range.Height;
TS.Objects.Add("PrxVisualizerLegend", Pos);
Visualizer := TS.Objects.Item(TS.Objects.Count - 1).Extension As IPrxVisualizerLegend;
Grid := Report.DataArea.Views.Item(0) As IEaxGrid;
i := Grid.Legends.Add(Grid.IndicatorLegendAssignment(EaxGridIndicatorType.BackgroundColor));
Visualizer.SetEaxObjectLegend(Grid, EaxGridIndicatorType.BackgroundColor);
End Sub UserProc;
After executing the example table legend will be created in table cell range selected by user.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Visualizators;
…
Private Sub UserProc();
Var
Report: IPrxReport;
TS: ITabSheet;
Grid: IEaxGrid;
Pos: GxRectF = New GxRectFClass();
Visualizer: IPrxVisualizerLegend;
i: Integer;
Begin
// Get regular report
Report := UiReportNet1.ReportUi.Report;
// Get active report sheet
TS := (Report.ActiveSheet As IPrxTable) As ITabSheet;
// Insert table legend in the report
Pos.Create(0, 0, 0, 0);
Pos.Left := TS.View.Selection.Range.Location.X;
Pos.Top := TS.View.Selection.Range.Location.Y;
Pos.Width := TS.View.Selection.Range.Width;
Pos.Height := TS.View.Selection.Range.Height;
TS.Objects.Add("PrxVisualizerLegend", Pos);
Visualizer := TS.Objects.Item[TS.Objects.Count - 1].Extension As IPrxVisualizerLegend;
Grid := Report.DataArea.Views.Item[0] As IEaxGrid;
i := Grid.Legends.Add(Grid.IndicatorLegendAssignment[EaxGridIndicatorType.egitBackgroundColor As Integer]);
Visualizer.SetEaxObjectLegend(Grid, EaxGridIndicatorType.egitBackgroundColor As Integer);
End Sub UserProc;
See also: