MVCxPivotGridExportSettings.CustomExportFieldValue Property
Enables you to render a different content for individual field values, if the PivotGrid is exported in the WYSIWYG mode.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
Declaration
public EventHandler<WebCustomExportFieldValueEventArgs> CustomExportFieldValue { get; set; }
Property Value
Type | Description |
---|---|
EventHandler<WebCustomExportFieldValueEventArgs> | A delegate method allowing you to implement custom processing. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to CustomExportFieldValue |
---|---|
PivotGridSettings |
|
Remarks
The CustomExportFieldValue event occurs for each field value when the PivotGrid is being exported in WYSIWYG mode, exported to PDF or printed. You can handle this event to change the field value’s appearance and contents in a printed document.
Note
The complete sample project How to obtain the appointment, resource or time interval selected by an end-user is available in the DevExpress Examples repository.
settings.SettingsExport.CustomExportFieldValue = (sender, e) =>
{
if (e.Field != null)
{
if (e.Field.FieldName == "ProductName")
{
e.Brick.Url = String.Format("https://www.google.com/search?q={0}", e.Text);
((DevExpress.XtraPrinting.TextBrick)e.Brick).Target = "_blank";
}
if (e.Field.FieldName == "Country" && e.Text == "USA")
{
DevExpress.XtraPrinting.ImageBrick imBrick = new DevExpress.XtraPrinting.ImageBrick();
imBrick.Image = Image.FromFile(HttpContext.Current.Server.MapPath("~/Content/us.png"));
imBrick.SizeMode = DevExpress.XtraPrinting.ImageSizeMode.AutoSize;
e.Brick = imBrick;
}
}
};
Tip
The CustomExportFieldValue and MVCxPivotGridExportSettings.CustomExportCell events are not in effect during the export in Data-Aware mode. To customize cells in Data-Aware export mode, use the PivotXlsExportOptions.CustomizeCell and PivotXlsxExportOptions.CustomizeCell events.