The Grid component allows you to export data in XLS, XLSX, and CSV formats. You can also use DevExpress Reporting tools to implement export to different formats (PDF, XLSX, and DOCX). This example illustrates how to accomplish this task in a Blazor WebAssembly application.
The export application should connect to the same port that the Web API application uses. Start the Web API application, copy the port number from the URL, and paste the clipboard content to the MyWebApiUrl
variable:
The code example uses the GridDevExtremeDataSource to bind the Grid to an IQueryable data collection published as an HTTP service. The CustomizeLoadOptions property customizes load options before the Grid loads data.
The ExportButtons component displays buttons that allow you to export data to PDF, XLSX, and DOCX files. When you click a button, it sends a request with the corresponding file format to the ExportedDocument controller method. The method creates a report based on the Grid layout and exports the report to a PDF, XLSX, or DOCX file. Once the export operation is completed, the button downloads the resulting file to your computer.
- Grid for Blazor - How to use DevExpress Reporting tools to implement export in a server application
- Grid for Blazor - How to bind the Web API Service
- How to Integrate Blazor Server Reporting (JavaScript-Based) Controls in DevExpress Blazor Application
(you will be redirected to DevExpress.com to submit your response)