LinkBase.CreateMarginalHeaderArea Event
Occurs when a marginal page header section of the document is being generated.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v18.2.Core.dll
Declaration
public event CreateAreaEventHandler CreateMarginalHeaderArea
Public Event CreateMarginalHeaderArea As CreateAreaEventHandler
Event Data
The CreateMarginalHeaderArea event's data class is CreateAreaEventArgs. 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):
- CreateMarginalHeaderArea
- LinkBase.CreateMarginalFooterArea
- LinkBase.CreateInnerPageHeaderArea
- LinkBase.CreateInnerPageFooterArea
- LinkBase.CreateReportHeaderArea
- LinkBase.CreateDetailHeaderArea
- LinkBase.CreateDetailArea
- LinkBase.CreateDetailFooterArea
- LinkBase.CreateReportFooterArea
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.
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;
}