ASPxGridViewExporter Class
An ASPxGridViewExporter control used to export the ASPxGridView control’s data.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v18.2.dll
Declaration
Related API Members
The following members return ASPxGridViewExporter objects:
Remarks
The ASPxGridViewExporter component allows you to export the ASPxGridView’s data to a file or stream in various formats - PDF, RTF, XLSX, and XLS. To learn more, see Built-in Export .
Note that the ASPxGridViewExporter
cannot export data columns that are hidden, nor can it export the content of templates. The exception is the ASPxGridView control within a GridViewTemplates.DetailRow template. ASPxGridViewExporter can identify a grid within this type of template, and allows both master and detail data to be exported.
Templated elements are exported with their default representation. For instance, if you export a grid with templated cells, they are represented as default labels with text in the obtained file.
Important
- Don’t export the ASPxGridView’s content during callbacks, because ASP.NET does not support sending binary content during a callback.
- Before exporting a grid, the ASPxGridViewExporter component creates an export document on a server. Therefore, when you export a large amount of data to a server with limited memory, the OutOfMemoryException exception can appear.
- Add the
ASPxGridViewExporter
to the page’s controls and recreate it on every round-trip to the server if it’s created dynamically.
Example
This example demonstrates how to export grid data to a file in a PDF format using the ASPxGridBase.ExportPdfToResponse method.
PdfExportOptions options = new PdfExportOptions();
options.Compressed = false;
ASPxGridView1.ExportPdfToResponse(options);