diff --git a/blazor/datagrid/excel-export-options.md b/blazor/datagrid/excel-export-options.md index c2376962a6..5051206b0a 100644 --- a/blazor/datagrid/excel-export-options.md +++ b/blazor/datagrid/excel-export-options.md @@ -1029,7 +1029,9 @@ To add additional worksheets during export: 3. Set the [GridSheetIndex](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.ExcelExportProperties.html#Syncfusion_Blazor_Grids_ExcelExportProperties_GridSheetIndex) property to **0** to specify the worksheet index where the Grid data should be placed. -4. Invoke the [ExportToExcelAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ExportToExcelAsync_Syncfusion_Blazor_Grids_ExcelExportProperties_) or [ExportToCsvAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ExportToCsvAsync_Syncfusion_Blazor_Grids_ExcelExportProperties_) to export the Grid with the additional worksheets. +4. The Grid exports data to the first worksheet by default, you can customize the sheet name using the **Workbook.Worksheets[0].Name** property. Optionally, you can use the `GridSheetIndex` property to specify the worksheet index used for exporting. + +5. Invoke the [ExportToExcelAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ExportToExcelAsync_Syncfusion_Blazor_Grids_ExcelExportProperties_) or [ExportToCsvAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ExportToCsvAsync_Syncfusion_Blazor_Grids_ExcelExportProperties_) to export the Grid with the additional worksheets. Two extra blank worksheets are added along with the worksheet containing the Grid data in this configuration. @@ -1072,6 +1074,9 @@ Two extra blank worksheets are added along with the worksheet containing the Gri ExportProperties.Workbook.Worksheets.Add(); // Define the Gridsheet index where Grid data must be exported. ExportProperties.GridSheetIndex = 0; + //Access the first worksheet and assign a custom name + // Worksheets collection is available after Workbook initialization + ExportProperties.Workbook.Worksheets[0].Name = "My Exported Data"; await Grid.ExportToExcelAsync(ExportProperties); } } @@ -1128,7 +1133,7 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/BtVytTCWguoXpvbV?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/VtrxNHZhrfXTmOyO?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} ## Conditional cell formatting