A newer version of this page is available. Switch to the current version.

XRPivotGrid.PrintFieldValue Event

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

public event EventHandler<CustomExportFieldValueEventArgs> PrintFieldValue
Public Event PrintFieldValue As EventHandler(Of CustomExportFieldValueEventArgs)

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.

Examples

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;
    }
}
See Also