View Full Version : [CLOSED] Grid to Excel

Aug 22, 2012, 6:28 PM
I am using Ext.NEt 2.1, Razor and MVC. I have several grid panels where I need to provide functionality to export the grids to Excel. Can you give me an MVC, best-practice way to do this? Also, all my grids have paging, but it is done at the client. Further, I need my grids to export the data exactly as they are laid out in the grid - with the exception that there will be no breaks or visual indication of paging. This means that if a user has changed the sort or column order of a grid, that should be reflected in the Excel output.

Thanks in advance.

Aug 22, 2012, 6:52 PM
The best place to start would be investigating the samples within the Examples Explorer. I believe each of these scenarios are demonstrated, although the code samples would have to be adapted to MVC. That's a fairly simple process though.

Hope this helps.

Aug 23, 2012, 4:48 AM

Just some links.

Here is the thread with an example for Ext.NET v1.

Here is the related Ext.NET v2 thread.

Aug 23, 2012, 5:57 PM
Here is the related Ext.NET v2 thread.

This link is VERY helpful. However there are 2 lines of code that are causing an issue:

writer = XmlWriter.Create(s, settings);
xt.Transform(xml, writer);

There is no create on the XMLWriter and the transform is stating to matching definition. I am using 2.1RC. Have these functionalities been moved or reworked?

Aug 23, 2012, 6:24 PM
XmlWriter is class from System.Xml assembly