Skip to main content

DxGrid.ExportToXlsAsync(Stream, GridXlExportOptions) Method

Exports grid data to a stream in XLS format.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public Task ExportToXlsAsync(
    Stream stream,
    GridXlExportOptions options = null
)

Parameters

Name Type Description
stream Stream

The target stream for grid data export.

Optional Parameters

Name Type Default Description
options GridXlExportOptions null

An object that contains export options.

Returns

Type Description
Task

The task that is completed when the file is exported.

Remarks

Call the ExportToXlsAsync method to export grid data in XLS format. The method overloads allow you to write the result to a stream (the current overload) or to a file downloaded to a client machine (ExportToXlsAsync(String, GridXlExportOptions)).

The method accepts a GridXlExportOptions object as a parameter. You can use this parameter to set up export settings.

Run Demo: Grid - Export

For more information about data export in the Grid component, refer to the following topic: Export Data in Blazor Grid.

Export Specifics and Limitations

  • Content of templates is not exported, including detail grids.
  • Custom summaries implemented in the CustomSummary grid event, are exported as plain text.
  • Data columns anchored to the right edge become regular columns, while columns anchored to the Grid’s left edge remain frozen.
  • Appearance settings applied by style settings or in the CustomizeElement event handler are not exported. You can handle the CustomizeCell event to customize grid elements’ appearance in the the exported document.
  • The ExportToXlsAsync method does not work if the grid is bound to a Server Mode data source or to a GridDevExtremeDataSource object.

See the following article for more information about Microsoft Excel limitations (for example, row count and column count): Excel specifications and limits.

See Also