LinkBase.CreateMarginalHeaderArea Event

Occurs when a marginal page header section of the document is being generated.

Namespace: DevExpress.XtraPrinting

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

Declaration

public event CreateAreaEventHandler CreateMarginalHeaderArea
Public Event CreateMarginalHeaderArea As CreateAreaEventHandler

Event Data

The CreateMarginalHeaderArea event handler receives an argument of the CreateAreaEventArgs type. The following properties provide information specific to this event.

Property Description
Graph Gets a BrickGraphics object used to draw in the current report.

Remarks

Handle the CreateMarginalHeaderArea event to customize the marginal page header section of a document.

The content specified via the CreateMarginalHeaderArea and LinkBase.CreateMarginalFooterArea methods is shifted by the values of the Top and Bottom margins (defined via the LinkBase.MinMargins property), respectively.

Document creation events occur in the following order (this order may be different in descendants of the LinkBase class):

For more information on handling events, see Events and Delegates in MSDN.

Examples

The following example demonstrates how to write a LinkBase.CreateMarginalHeaderArea event handler. The handler will not work unless you write a LinkBase.CreateDetailArea event handler.

Tutorial Areas

using System.Drawing;
using DevExpress.XtraPrinting;
// ...

private void link1_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) {
    string format = "Page {0} of {1}";
    e.Graph.Font = e.Graph.DefaultFont;
    e.Graph.BackColor = Color.Transparent;

    RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height);

    PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, 
        Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Far;
    brick.AutoWidth = true;

    brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Near;
    brick.AutoWidth = true;
}
See Also