Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XRPivotGrid.PrintHeader Event

Enables you to render a different content for individual field headers.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

public event EventHandler<CustomExportHeaderEventArgs> PrintHeader

#Event Data

The PrintHeader event's data class is DevExpress.XtraReports.UI.PivotGrid.CustomExportHeaderEventArgs.

#Remarks

The PrintHeader event is raised for each field when the XRPivotGrid is being printed. You can handle this event to change the field header’s appearance and contents in a printed document.

#Example

This example demonstrates how to change the appearance of Pivot Grid headers, based on their captions, using the XRPivotGrid.PrintHeader event.

using System;
using System.Drawing;
using DevExpress.XtraPivotGrid;
using DevExpress.XtraReports.UI;
// ...

private void xrPivotGrid1_PrintHeader(object sender, DevExpress.XtraReports.UI.PivotGrid.CustomExportHeaderEventArgs e) {
    if (e.Caption == "Country") 
        e.Appearance.BackColor = Color.Yellow;
}
See Also