Version

Managing the Export Through Handling Export Events

The DataPresenterWordWriter object exposes several events that you can handle to modify the exporting process. The events are raised for each element that is exported during the exporting process. For example, the LabelExporting event is raised for each column header that is exported. Most of the events allow you to modify the exported data, e.g. apply formatting or change the value to be exported.

Table 1 explains the supported export events in the order of in which they are raised.

Table 1: Descriptions of the export events

Event Description

Raised at the beginning of the export process before any records have been exported. The event may be used to hook events of the grid used for the export operation or to add content to the WordDocumentWriter prior to the exporting of any records.

Raised before exporting a DataRecord, GroupByRecord, SummaryRecord, or ExpandableFieldRecord. You can skip the export of the specified record, its sibling records or descendant records. You can also cancel an export process by setting the TerminateExport property of the InitializeRecordEventArgs.

Raised before exporting a column header.

Raised before exporting a data record value.

Raised before exporting each result of a summary.

Raised just before the ExportEnded event and provides information about canceling the current export process (if any). The event is raised before the associated WordDocumentWriter is closed; this allows additional information to be added to the document before closing it.

Raised at the end of the export process and signals its completion.