PDA

View Full Version : [CLOSED] Grid to Excel



adelaney
Aug 22, 2012, 7: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.

geoffrey.mcgill
Aug 22, 2012, 7: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.

Daniil
Aug 23, 2012, 5:48 AM
Hi,

Just some links.

Here is the thread with an example for Ext.NET v1.
http://forums.ext.net/showthread.php?14196

Here is the related Ext.NET v2 thread.
http://forums.ext.net/showthread.php?20352

adelaney
Aug 23, 2012, 6:57 PM
Here is the related Ext.NET v2 thread.
http://forums.ext.net/showthread.php?20352

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?

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