Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.15 KB

Excel_export.md

File metadata and controls

28 lines (18 loc) · 1.15 KB

Blazor WASM with GridMvcCore back-end (REST API)

Export to Excel

Index

Grids can be exported to an Excel file. You have to use the SetExcelExport method of the GridClient object:

    var client = new GridClient<Order>(HttpClient, url, query, false, "ordersGrid", Columns)
        .SetExcelExport(true, false, "Orders"));

The SetExcelExport method has 3 parameters, one of them is required:

Parameter Description
enabled bool to enable Excel export (required)
allRows bool to enable export of all grid rows (optional). The default value is false and only visible rows are exported
fileName string to define the file name (optional). If no value is defined, the grid internal name is used as file name

This is an example of a grid with an export to Excel button:

Grid columns can be customised as hidden (or not) specifically when exporting to Excel; either by calling SetExcelHidden(bool?) or setting the ExcelHidden property on the column definition.

<- Embedded components on the grid | Grid dimensions ->