The requested page is not available for the requested platform. You are viewing the content for Default platform.

XtraReport.Pages Property

Gets a collection of pages generated for this report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

[Browsable(false)]
public PageList Pages { get; }
<Browsable(False)>
Public ReadOnly Property Pages As PageList

Property Value

Type Description
PageList

A PageList object, specifying a collection of pages.

Remarks

After calling the XtraReport.CreateDocument method (or after calling the PrintTool.ShowPreview or PrintTool.ShowPreviewDialog methods for the first time), you can access all pages of the generated Document using the Pages property.

The PageList object, which is the returned collection of pages, exposes methods that allow you to reorder and remove pages, as well as to add and insert pages from other reports (see Merging Reports for details).

The following code reorders document pages to produce a booklet (first page, last page, second page, last but one, third page, etc.):

using DevExpress.XtraReports.UI;
// ...

private void CreateBooklet() {
    // Create the 1st report and generate its document.
    XtraReport1 report1 = new XtraReport1();
    report1.CreateDocument();

    // Preserve the original page numbers on all pages.
    report1.PrintingSystem.ContinuousPageNumbering = false;

    // Create a booklet.
    int centerPageIndex = Convert.ToInt32((report1.Pages.Count - 1) / 2);
    for (int i = 0; i < centerPageIndex; i++) {
        report1.Pages.Insert(i * 2 + 1, report1.Pages[report1.Pages.Count - 1]);
    }

    // Show the Print Preview form (in a WinForms application).
    ReportPrintTool printTool = new ReportPrintTool(report1);
    printTool.ShowPreviewDialog();
}

You can also add an empty page using the PrintingSystemBase.CreatePage method of the report's XtraReport.PrintingSystem.

Use the PrintingSystemBase.ContinuousPageNumbering property to specify whether to update the page numbers after customizing the collection of pages or preserve the page numbers from the original document(s).

See Also