0

Is their any way to create the excel sheet with the data loaded from grid in extjs. Going through this link,I have not clearly understood the appraoch and how to achieve my goal.Other related questions were e.g here,but could not get anything out of it.Please help me resolve this.Any help is appreciated.Thanks.

Community
  • 1
  • 1
Dev
  • 3,922
  • 3
  • 24
  • 44

2 Answers2

1

The general concept is that an Excel file is actually XML, at least in the more recent versions of Excel. You can create plain XML that just contains the data. Or you can add a lot of formatting, use the rich presentation that Excel provides. I would suggest that you start off as simply as possible, with just the data, and then add complexity.

To learn how to do this, you need to understand how to generate any XML, then the particular XML that Excel requires, and then how to return that mime type to the browser.

Here is one place (of many) that you can find the XML for Excel.

DOK
  • 32,337
  • 7
  • 60
  • 92
  • Thank you for your instant reply.Can you please interpret it somemore with some example(snippet).Thanks – Dev May 20 '13 at 13:36
  • Sorry, Daemon, I don't know anything about extjs. However, if you do a Google search for "extjs grid export to excel" you should be able to find some code to copy and paste. – DOK May 20 '13 at 13:51
0

The better option is for export to be handled from the server side rather than from the client-side script. A new request for export can be sent to the server with the currently applied filters and get the file in generated in excel using Apache FOP or similar libraries(http://xmlgraphics.apache.org/fop/).

Export from extjs raises some problems like 1) what data would you expect for a paged grid. 2) what about the filters applied on the grid

Navya R
  • 615
  • 1
  • 10
  • 16