Export Grid to Excel
Cancel
The title field is required!
Thread is closed for posting
1
posts,
0
answers
-
63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
1572
posts
Member since:
Oct 2004
Posted 13 Aug 2012
Link to this post
Kendo UI Suite and Version
|
2013.3.1119
|
jQuery Version
|
1.9.1
|
Supported Browsers and Platforms
|
All supported by Kendo UI
|
Components/Widgets used
|
Grid
|
ASP.NET MVC Version
|
4.0 |
PROJECT DESCRIPTION
In numerous cases you may need to export the data displayed by the Grid. This Code Library demonstrates two similar ways how to implement Excel export in a few lines of code.
The difference between the two approaches is in the third party libraries used on the server side to generate the excel file.
The first approach relies on the open source project NPOI and the second one relies on the Open XML SDK by Microsoft.
To implement the second there is utility class used from the following blogpost by John DeVight.
The sample page contains two grids each one with a hyperlink in the toolbar. When clicked the hyperlink requests the controller methods which will export the corresponding Grid data and stream it back as Excel file. The "dataBound" client-side events of the grids handle the update of the URL arguments of the different links required for export (current page, order and filter expressions).
-