XtraReport.PaperKind Property
Gets or sets the report’s paper kind.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.2.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
[DefaultValue(PaperKind.Letter)]
[SRCategory(ReportStringId.CatPageSettings)]
[XRLocalizable(true)]
public PaperKind PaperKind { get; set; }
Property Value
Type | Default | Description |
---|---|---|
PaperKind | Letter | The report’s paper kind. |
Remarks
Set the paper type to the Custom value to specify the report’s XtraReport.PageWidth, XtraReport.PageHeight, and XtraReport.PageSize. Any other paper kind value sets the predefined report page width, height and size.
Note
The default PaperKind value depends on the global Report Units value:
- Report Units = TenthsOfAMillimeter: the PaperKind property is set to A4.
- Report Units = HundredthsOfAnInch: the PaperKind property is set to Letter.
If the PaperKind property is set to Custom, the printer paper is selected according to the XtraReport.PaperName property value. In this case, set the XtraReport.PageWidth and XtraReport.PageHeight properties to paper’s width and height.
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;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the PaperKind property.
Note
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.