Version

CellExporting Event

Occurs before a grid cell is exported to a report.
Syntax
'Declaration
 
Public Event CellExporting As EventHandler(Of CellExportingEventArgs)
public event EventHandler<CellExportingEventArgs> CellExporting
Event Data

The event handler receives an argument of type CellExportingEventArgs containing data related to this event. The following CellExportingEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
CellValue Returns the grid cell value.
ExportValue Gets or sets the value that will be exported to the report.
GridColumn Returns the Infragistics.Win.UltraWinGrid.UltraGridColumn which contains the cell being exported.
GridRow Returns the Infragistics.Win.UltraWinGrid.UltraGridRow containing the cell.
ReportCell Returns the Infragistics.Documents.Reports.Report.Grid.IGridCell into which the contents of the cell will be exported.
Remarks

CellExportingEventArgs.GridRow returns the Infragistics.Win.UltraWinGrid.UltraGridRow containing the cell.

CellExportingEventArgs.GridColumn returns the associated Infragistics.Win.UltraWinGrid.UltraGridColumn.

CellExportingEventArgs.ReportCell returns the Infragistics.Documents.Reports.Report.Grid.IGridCell into which the contents of the cell will be exported.

This event fires for data cells only. It will not fire for header or summary cells. For header cells, use HeaderCellExporting. For summary cells, use SummaryCellExporting.

Use the Cancel argument to cancel the exporting of a cell.

Using these event arguments, it is possible to override the exporting of a cell and provide a custom export. Typically, this would be done by setting Cancel to True, and then adding content to the ReportCell.

Example
Imports Infragistics.Documents.Report
Imports Infragistics.Win.UltraWinGrid.DocumentExport
Imports Infragistics.Documents.Report.Section
Imports Infragistics.Documents.Report.Text

Private Sub ultraGridDocumentExporter1_CellExporting(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.CellExportingEventArgs) Handles ultraGridDocumentExporter1.CellExporting
	' Check to see if this is the 'Int32 1' columns. 
	If (e.GridColumn.Key = "Int32 1") Then

		' Instead of exporting the value, just export a string indicating negative, 
		' zero, or positive. 

		' Get the value of the cell as an integer
		Dim cellValueAsInteger As Integer = CType(e.CellValue, Integer)

		' Change the ExportValue. This will not effect the on-screen grid or the 
		' underyling data, only the report. 
		Select Case cellValueAsInteger
			Case Is < 0
			e.ExportValue = "Negative"
				Case 0
			e.ExportValue = "Zero"
				Case Else
			e.ExportValue = "Positive"
		End Select
	End If
End Sub
using Infragistics.Documents.Report;
using Infragistics.Win.UltraWinGrid.DocumentExport;
using Infragistics.Documents.Report.Section;
using Infragistics.Documents.Report.Text;

private void ultraGridDocumentExporter1_CellExporting(object sender, CellExportingEventArgs e)
{
	// Check to see if this is the 'Int32 1' columns. 
	if (e.GridColumn.Key == "Int32 1")
	{
		// Instead of exporting the value, just export a string indicating negative, 
		// zero, or positive. 

		// Get the value of the cell as an integer
		int cellValueAsInteger = (int)e.CellValue;

		// Change the ExportValue. This will not effect the on-screen grid or the 
		// underyling data, only the report. 
		if (cellValueAsInteger < 0)
			e.ExportValue = "Negative";
		else if (cellValueAsInteger == 0)
			e.ExportValue = "Zero";
		else
			e.ExportValue = "Positive";
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also