Back to Devexpress

XRLine Class

xtrareports-devexpress-dot-xtrareports-dot-ui-0231687a.md

latest4.2 KB
Original Source

XRLine Class

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

Declaration

csharp
public class XRLine :
    XRControl
vb
Public Class XRLine
    Inherits XRControl

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:25.2: 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:

Create a Line in Code

This example creates the XRLine control in code and sets the control’s properties.

csharp
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;
}
vb
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

Implements

IScriptable

Inheritance

Object MarshalByRefObject Component XRControl XRLine

See Also

XRLine Members

Add Controls to a Report

DevExpress.XtraReports.UI Namespace