PDA

View Full Version : Exporting Grid Panel content to xml (Server Side)



kad_87
19 Dec 2012, 8:07 AM
Hello Everyone,

I'm developping a web application using ExtJS 4.1 components, I want to extract the content of Grid Panel to Excel format or something readable like Excel. The server side is coded with c#.
I searched for threads in this forum, but they don't seem to work with ExtJS 4.1 version.

Any help would be appreciable !

tvanzoelen
20 Dec 2012, 12:24 AM
Where is the data from the grid coming from? From the server or is it user input?

kad_87
20 Dec 2012, 1:29 AM
Where is the data from the grid coming from? From the server or is it user input?
Thanks for your attention. =;
It's coming from the server, specifically from a SQL database. So the server will generate the xls file and send a link to the client !

tvanzoelen
20 Dec 2012, 1:36 AM
In that case why you don't generate a xml file directly from the database data?

I think the best way to do it is post a request to your server (from a button in the grid or something), generate xml in stead of json and serve the file.

Serving a file you can do with a hidden iframe

kad_87
20 Dec 2012, 1:44 AM
The problem , is that I have a filter beside the datagrid, so i'm not willing to export the whole database, just the lines resulting from a search with this filter, unless the client chose to export all the data. So I'm guessing the whole work will be server side (c#) , I think that there are solutions to do such thing, I just can't find the right one.

tvanzoelen
20 Dec 2012, 1:47 AM
You send the filters with the request of course and you extract the data from the database according to these filters.

I think there are not much example found where griddata (that comes from a server) is send back to that server. Just make a request with the filters and the desired dataset and pull that data out of the database.

kad_87
20 Dec 2012, 1:56 AM
You send the filters with the request of course and you extract the data from the database according to these filters.

I think there are not much example found where griddata (that comes from a server) is send back to that server. Just make a request with the filters and the desired dataset and pull that data out of the database.

I'll take a look at that ! thanks for the quick answer ! Have a nice day !