HatchStyle: GxHatchStyle;
HatchStyle: Prognoz.Platform.Interop.Drawing.GxHatchStyle;
The HatchStyle property determines legend background hatching type.
This property is relevant if the IMapBackground.Type property uses the MapBackgroundType.Hatch fill type.
Executing the example requires that the repository contains a form containing the components:
ReportBox with the ReportBox1 identifier.
UiReport with the UiReport1 identifier that is a data source for ReportBox1.
It is also required to have a regular report containing a map with enabled legend that is a data source for UiReport1.
Add links to the Map, Report, Tab system assemblies.
Sub UserProc;
Var
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
objects: ITabObjects;
map: IMap;
legend: IMapLegend;
background: IMapBackground;
Begin
// Get regular report
regrep := UiReport1.Report;
// Get map from regular report
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
objects := table.TabSheet.Objects;
map := objects.Item(0).Extension As IMap;
// Get map legend
legend := map.View.Legend;
// Get legend background on map
background := legend.Background;
// Set legend background type that is hatching
background.Type := MapBackgroundType.Hatch;
// Set new hatching type for legend background
background.HatchStyle := hatchstyle.Sphere;
// Refresh map
map.Refresh;
End Sub UserProc;
After executing the example legend background is hatched with circles.
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.Map;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Sub UserProc();
Var
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
objects: ITabObjects;
map: IMap;
legend: IMapLegend;
background: IMapBackground;
Begin
// Get regular report
regrep := UiReportNet1.ReportUi.Report;
// Get map from regular report
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
objects := table.TabSheet.Objects;
map := objects.Item[0].Extension As IMap;
// Get map legend
legend := map.View.Legend;
// Get legend background on map
background := legend.Background;
// Set legend background type that is hatching
background.Type := MapBackgroundType.mbtHatch;
// Set new hatching type
background.HatchStyle := GxHatchStyle.ghsSphere;
// Refresh map
map.Refresh();
End Sub UserProc;
See also: