Skip to content

khamlyuk/blazor-webassembly-dxdatagrid-export

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Grid for Blazor - How to use DevExpress Reporting tools to implement export in a WASM application

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

This example illustrates how to use DevExpress Reporting tools to export Data Grid's content to different file formats (.pdf/.xlsx/.docx) in a Blazor WebAssembly application.

Resulting Application

In this example, the Data Grid uses its CustomData property to bind to the external Web API service. Use the script generation file in the DBBackup folder to generate data on your SQL server and change the connection string in NWINDContext.cs file (see the OnConfiguring method).

Your export and Web API applications should have the same port. Start the Web API application, copy the port number from the URL, and paste the buffer content to the MyWebApiUrl variable:

Localhost Port

The ExportButtons component contains export buttons. Each export button contains an URI to a specific ExportedDocument controller method in the Web API service. This URI contains DataGrid's options, and the created report contains only data that is visible in the grid after sort and filter operations.

Use the ReportHelper.CreateReport method with the ExportToPdf(String), ExportToXlsx(Stream), or ExportToDocx(Stream) methods to create a report that is exported to the file of the corresponding type.

Files to Look At

Documentation

More Examples

Releases

No releases published

Packages

No packages published

Languages

  • C# 75.8%
  • HTML 24.2%