xtrareports-devexpress-dot-xtrareports-dot-ui-0231687a.md
A control that allows you to draw lines in reports.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public class XRLine :
XRControl
Public Class XRLine
Inherits XRControl
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.
Drag the XRLine item from the DX:25.2: Report Controls Toolbox tab and drop the item onto the report to add a line.
Click the line’s smart tag to access the main control properties:
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;
}
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports DevExpress.XtraReports.UI
' ...
Public Function CreateXRLine()
' Create a line.
Dim Line As 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
End Function
Object MarshalByRefObject Component XRControl XRLine
See Also