Skip to main content
A newer version of this page is available. .

PageHeaderArea Class

Represents the object that specifies information to be displayed in a page header area.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v20.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core

Declaration

public class PageHeaderArea :
    PageArea

Remarks

An instance of the PageHeaderArea class is returned by the PageHeaderFooter.Header property, and specifies information to be displayed in a page header (PageArea.Content), as well as defining how it is displayed (PageArea.Font and PageArea.LineAlignment).

Example

This example demonstrates how to use the link’s PageHeaderFooter to add extra information to the document’s page header.

Tip

A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/e1021/how-to-insert-system-information-to-the-page-header-and-footer.

using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
// ...

private void button1_Click(object sender, EventArgs e) {
    string leftColumn = "Pages: [Page # of Pages #]";
    string middleColumn = "User: [User Name]";
    string rightColumn = "Date: [Date Printed]";

    // Create a PageHeaderFooter object and initializing it with
    // the link's PageHeaderFooter.
    PageHeaderFooter phf = printableComponentLink1.PageHeaderFooter as PageHeaderFooter;

    // Clear the PageHeaderFooter's contents.
    phf.Header.Content.Clear();

    // Add custom information to the link's header.
    phf.Header.Content.AddRange(new string[] { leftColumn, middleColumn, rightColumn });
    phf.Header.LineAlignment = BrickAlignment.Far;

    // Show the document's preview.
    printableComponentLink1.ShowPreview();
}

Inheritance

Object
PageArea
PageHeaderArea
See Also