Skip to content

DevExpress-Examples/blazor-server-dxgrid-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blazor Grid - How to Export Data to DOCX, HTML, and MHT formats in a server application

The Grid component allows you to export data to PDF, XLS, XLSX, and CSV file formats. You can also use DevExpress Reporting tools to implement export to different formats (DOCX, HTML, and MHT). This example illustrates how to do this in a Blazor Server application.

Exported Docx

The DxGrid component is bound to an IQueryable data collection (use the GridDevExtremeDataSource). The CustomizeLoadOptions property is used to obtain information about the grid's state.

To export information, apply the ExportMiddleware type to the application request pipeline. The ExportMiddleware handles requests. The response returns the file of the corresponding type.

The ExportButtons component contains export buttons. Each export button contains an URI to this project, and the URI contains the Grid options. The created report contains only data that is visible in the grid after sort and filter operations. The ExportMiddleware processes the request with the URI.

Use the ReportHelper.CreateReport method with the ExportToDocx(Stream)/ExportToHtml(Stream)/ExportToMht(String) methods to create a report that is exported to the file of the corresponding type.

Files to look at

Documentation and Demos

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Export Grid content to different file formats.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 8