Blazor DataGrid Example - Advanced Exporting
This sample demonstrates the DataGrid's advanced exporting, which allows you to export its data to Excel and PDF file formats with a custom header and footer.
Product ID | Product Name | Quantity per Unit | Units in Stock | Unit Price |
|---|
| 1 | Chai | 10 boxes x 20 bags | 39 | $18.00 |
| 2 | Chang | 24 - 12 oz bottles | 17 | $19.00 |
| 3 | Aniseed Syrup | 12 - 550 ml bottles | 13 | $10.00 |
| 4 | Chef Anton's Cajun Seasoning | 48 - 6 oz jars | 53 | $22.00 |
| 5 | Chef Anton's Gumbo Mix | 36 boxes | 0 | $21.35 |
| 6 | Grandma's Boysenberry Spread | 12 - 8 oz jars | 120 | $25.00 |
| 7 | Uncle Bob's Organic Dried Pears | 12 - 1 lb pkgs. | 15 | $30.00 |
| 8 | Northwoods Cranberry Sauce | 12 - 12 oz jars | 6 | $40.00 |
| 9 | Mishi Kobe Niku | 18 - 500 g pkgs. | 29 | $97.00 |
| 10 | Ikura | 12 - 200 ml jars | 31 | $31.00 |
| 11 | Queso Cabrales | 1 kg pkg. | 22 | $21.00 |
| 12 | Queso Manchego La Pastora | 10 - 500 g pkgs. | 86 | $38.00 |
The Blazor DataGrid supports advanced exporting, allowing you to save data to Excel and PDF file formats with custom content and styles.
The ExcelExport and PdfExport toolbar items are defined in this demo. You defined actions in the OnToolbarClick event for these toolbar items to export the DataGrid data with header and footer using the ExportToExcelAsync and ExportToPdfAsync methods.
More information about the Exporting feature can be found in this documentation section.