XRShape Class
A Shape control.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v18.2.dll
Declaration
Remarks
Shape controls are typically used to embed any simple graphics into a report. The shape’s type is determined by the XRShape.Shape property, which returns an object containing settings for one of the shape types available in XtraReports. For example, the ShapeArrow class provides the ShapeArrow.ArrowHeight and ShapeArrow.ArrowWidth properties, allowing customizing the appearance of an arrow shown within the XRShape control.
In addition, the XRShape class features the XRShape.Angle property to specify the angle by which the shape’s image is rotated; the XRShape.LineWidth property - to specify the width of the line which is used to draw the shape image; the XRShape.FillColor property - to specify the color that fills the shape image; and the XRShape.Stretch property - to specify whether or not to stretch a shape, so it fills the client rectangle of a control when it’s rotated.
To learn more about the XRShape control, see the Drawing Shapes topic.
Example
This example demonstrates how to create an XRShape
Arrow type control, and set its basic properties.
Tip
Online Example: How to insert a shape control into a report
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting.Shape;
//...
private void button1_Click(object sender, EventArgs e) {
XtraReport1 report = new XtraReport1();
// Create a shape control.
XRShape shape = new XRShape();
// Set the shape's type to Arrow.
shape.Shape = new ShapeArrow();
// Adjust the Arrow shape's main properties.
shape.Angle = 90;
shape.Width = 200;
shape.Height = 200;
shape.ForeColor = Color.Brown;
shape.FillColor = Color.Beige;
shape.Stretch = false;
// Adjust the Arrow shape's specific properties.
((ShapeArrow)shape.Shape).ArrowHeight = 50;
((ShapeArrow)shape.Shape).ArrowWidth = 50;
((ShapeArrow)shape.Shape).Fillet = 20;
// Preview the report.
report.Detail.Controls.Add(shape);
ReportPrintTool pt = new ReportPrintTool(report);
pt.ShowPreviewDialog();
}