BorderStyle: TabBorderStyle;
BorderStyle: Prognoz.Platform.Interop.Tab.TabBorderStyle;
The BorderStyle property determines region border line type.
To determine region border color, use the ITabRegion.BorderColor property.
Executing the example requires that the repository contains a regular report with connected module. The connected module and the EventsClass class must be specified as event handler.
Add links to the Drawing, Report, Tab system assemblies.
Class EventsClass: ReportEvents
Public Sub OnAfterRecalcSheet(Sheet: IPrxSheet);
Var
Tab: ITabSheet;
Reg: ITabRegion;
Begin
// Get report sheet table
Tab := Sheet.Table;
// Add a region to collection
Reg := Tab.Regions.Add;
// Determine table range where region is located
Reg.Range := Tab.Cells(1, 1, 3, 3);
// Set background color of table region
Reg.BackgroundColor := New GxColor.CreateARGB(64, 255, 0, 0);
// Set border color of table region
Reg.BorderColor := New GxColor.CreateRGB(255, 0, 0);
// Set line type of table region border
Reg.BorderStyle := TabBorderStyle.Double;
// Set line width of table region border
Reg.BorderWeight := TabBorderWeight.Hairline;
// Set visibility of table region
Reg.Visible := True;
// Add the second region to collection
Reg := Tab.Regions.Add;
// Determine the second table range where region is located
Reg.Range := Tab.Cells(2, 2, 4, 4);
// Set formatting of the second table region
Reg.BackgroundColor := New GxColor.CreateARGB(64, 0, 0, 255);
Reg.BorderColor := New GxColor.CreateRGB(0, 0, 255);
Reg.Visible := True;
End Sub OnAfterRecalcSheet;
End Class EventsClass;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Class EventsClass: ReportEventArgsClass
Public Sub OnAfterRecalcSheet(Sheet: IPrxSheet);
Var
Tab: ITabSheet;
Reg: ITabRegion;
Color: GxColorClass_2 = New GxColorClass_2();
Begin
// Get report sheet table
Tab := Sheet.Table;
// Add a region to collection
Reg := Tab.Regions.Add();
// Determine table range where region is located
Reg.Range := Tab.Cells[1, 1, 3, 3];
// Set background color of table region
Color.CreateARGB(64, 255, 0, 0);
Reg.BackgroundColor := Color;
// Set border color of table region
Color.CreateRGB(255, 0, 0);
Reg.BorderColor := Color;
// Set line type of table region border
Reg.BorderStyle := TabBorderStyle.tbsDouble;
// Set line width of table region border
Reg.BorderWeight := TabBorderWeight.tbwHairline;
// Set visibility of table region
Reg.Visible := True;
// Add the second region to collection
Reg := Tab.Regions.Add();
// Determine the second table range where region is located
Reg.Range := Tab.Cells[2, 2, 4, 4];
// Set formatting of the second table region
Color.CreateARGB(64, 0, 0, 255);
Reg.BackgroundColor := Color;
Color.CreateRGB(0, 0, 255);
Reg.BorderColor := Color;
Reg.Visible := True;
End Sub OnAfterRecalcSheet;
End Class EventsClass;
After executing the example, after report update two regions will be selected that will have different colors and different borders.
See also: