XRLine Class
A control that allows you to draw lines in reports.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v24.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Remarks
The XRLine control allows you to draw a line with a specific direction, style, width, and color. You can use the control to decorate and visually separate the report’s sections. See the following demo for an example of how to separate invoice data from the invoice’s summary results: Invoice.
Note
You can draw a line only within one band. To draw a line across multiple bands, use XRCrossBandLine. To draw borders for report controls, use the Borders property instead of the XRLine control.
Add a Line to a Report
Drag the XRLine item from the DX:24.1: Report Controls Toolbox tab and drop the item onto the report to add a line.
Customize Appearance
Click the line’s smart tag to access the main control properties:
-
Enables you to draw a line horizontally, vertically, and diagonally (Horizontal, Vertical, Slant, Back Slant).
-
You can select the solid, dashed, dotted, or mixed line style.
-
Specifies the line width in pixels as a floating point value.
-
Specifies the vertical anchoring style for a line.
Create a Line in Code
This example creates the XRLine control in code and sets the control’s properties.
using System.Drawing;
using System.Drawing.Drawing2D;
using DevExpress.XtraReports.UI;
// ...
public XRLine CreateXRLine() {
// Create a line.
XRLine line = new XRLine();
// Set a color.
line.ForeColor = Color.Red;
// Set width.
line.LineWidth = 0.5F;
// Set a style.
line.LineStyle = DashStyle.DashDot;
// Set a size.
line.SizeF = new SizeF(300F, 100F);
// Set a direction.
line.LineDirection = LineDirection.BackSlant;
return line;
}