Skip to main content

XRPivotGrid.PrintFieldValue Event

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public event EventHandler<CustomExportFieldValueEventArgs> PrintFieldValue

Event Data

The PrintFieldValue event's data class is DevExpress.XtraReports.UI.PivotGrid.CustomExportFieldValueEventArgs.

Remarks

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

Example

This example demonstrates how to change the appearance of Pivot Grid value fields displayed in the column area using the XRPivotGrid.PrintFieldValue event.

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

private void xrPivotGrid1_PrintFieldValue(object sender, DevExpress.XtraReports.UI.PivotGrid.CustomExportFieldValueEventArgs e) {
    if (e.Field != null && e.Field.Area == DevExpress.XtraPivotGrid.PivotArea.ColumnArea) {
        LabelBrick lb = new LabelBrick();
        lb.BackColor = Color.Beige;
        lb.Padding = new PaddingInfo(2, 2, 5, 2, GraphicsUnit.Pixel);
        lb.Text = e.Text;
        e.Brick = lb;
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PrintFieldValue event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also