2

I want to export my GridPanel to Excel. I searched too many times but I couldn't find any acceptable solution.

Can you help me about this problem?

P.S.: I use ExtJS 3.2 and 3.3.1

vtokmak
  • 1,452
  • 6
  • 31
  • 66
  • 1
    Something like this ... http://stackoverflow.com/questions/4130849/convert-json-format-to-csv-format-for-ms-excel – hpavc Apr 26 '12 at 02:30
  • I tried that one but it's output is not ordered. It has data which is seperated by comma in one column and other column is something like that etc. – vtokmak May 02 '12 at 16:33

3 Answers3

1

There isn't any good solution to generate xls/xlsx in javascript.

Your best catch is to do it server-side.

Send ajax request to http://your-website.com/generate_xls containing all the data, and return xls headers and then body.

Here is a good PHP library, in case that you are using PHP: http://phpexcel.codeplex.com/

Nameless
  • 2,220
  • 4
  • 21
  • 28
  • I am using Spring 3 and, I think I will try server side solution if I can not find any good solution without using server side coding. – vtokmak Apr 23 '12 at 18:58
0

This is a server side job. Here is what I use for generating tabular reports which are based on Grid data: http://xmlgraphics.apache.org/fop/

Also, you can generate a very nice, fully functional Excel spreadsheet from tabular data: http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx

Benhar Upasana
  • 177
  • 1
  • 8
0

.With the launch of ExtJS 5, it's probably better to start porting your application to a newer version of ExtJS, at least 4.

We have created a front-end XLS(X) and CSV import and export tool that you can use in ExtJS 4 applications with a few lines of code. The user just drags the file on the grid and done. We just launched it, here is a description: http://2gears.com/2014/08/ext-js-excel-import-export-easy/

As said, the import and export is done ENTIRELY client side, so in applications with many concurrent users, this relieves the server from excessive load. In the next weeks also an import wizard will be added, that guides less capable users in importing files.

Hope it helps