XtraReport.Margins Property
Gets or sets the report’s page margins.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v22.1.dll
Declaration
[SRCategory(ReportStringId.CatPageSettings)]
[XRLocalizable(true)]
public Margins Margins { get; set; }
Property Value
Type | Description |
---|---|
Margins | The report’s page margins. |
Remarks
Margins are measured in report units (hundredths of an inch or tenths of a millimeter).
Example
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 System.Drawing.Printing;
using DevExpress.XtraReports.UI;
// ...
public static XtraReport CreateReport() {
XtraReport report = new XtraReport() {
Name = "SimpleStaticReport",
DisplayName = "Simple Static Report",
PaperKind = PaperKind.Letter,
Margins = new Margins(100, 100, 100, 100)
};
DetailBand detailBand = new DetailBand() {
HeightF = 25
};
report.Bands.Add(detailBand);
XRLabel helloWordLabel = new XRLabel() {
Text = "Hello, World!",
Font = new Font("Tahoma", 20f, FontStyle.Bold),
BoundsF = new RectangleF(0, 0, 250, 50),
};
detailBand.Controls.Add(helloWordLabel);
return report;
}
See Also