Skip to main content

XtraReport.Margins Property

Gets or sets the report’s page margins.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v23.2.dll

NuGet Package: DevExpress.Reporting.Core


public DXMargins Margins { get; set; }

Property Value

Type Description

The report’s page margins.


Margins are measured in report units (hundredths of an inch or tenths of a millimeter).

To set report margins, create a new DXMargins object and assign it to the XtraReport.Margins property. Do not change an individual setting (Top / Left / Bottom / Right) in the DXMargins object obtained with the XtraReport.Margins property.


The code sample below creates a new report, sets its name, display name, paper kind and margins, and adds the Detail Band band with the XRLabel control on it.


using System.Drawing;
using DevExpress.Drawing;
using DevExpress.Drawing.Printing;
using DevExpress.XtraReports.UI;
// ...
public static XtraReport CreateReport() {
    XtraReport report = new XtraReport() {
        Name = "SimpleStaticReport",
        DisplayName = "Simple Static Report",
        PaperKind = DXPaperKind.Letter,
        Margins = new DXMargins(100, 100, 100, 100)

    DetailBand detailBand = new DetailBand() {
        HeightF = 25

    XRLabel helloWordLabel = new XRLabel() {
        Text = "Hello, World!",
        Font = new DXFont("Tahoma", 20f, DXFontStyle.Bold),
        BoundsF = new RectangleF(0, 0, 250, 50),

    return report;

The following code snippets (auto-collected from DevExpress Examples) contain references to the Margins property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also