0

There is one requirement in javascript to export the data (array or array of objects) to excel xlsx. I already exported the data to csv but unable to do same for xlsx. I tried many api from github so that I can used the libraries and export it to xslx but there are little help for it. I tried using stephen-hardy/xlsx.js, SheetJS/js-xlsx etc.

For exporting to csv I used this Click here! but the same cant be done for xlsx.

I tried xlsxwriter also to convert and write javascript array or array of object to xlsx but no result.

Now I m badly stuck because of the requirement. I also found out the similar post as of mine requirement Click here!

Please guys give me solution if any

Community
  • 1
  • 1
Atiq Shaikh
  • 1
  • 1
  • 1
  • 2

2 Answers2

1

A while ago, I wrote the following article, which described how to export data from a jqGrid to a "real" .xlsx file:

Export jqGrid to Excel

This basically cached the jqGrid's data into a JavaScript variable, posted it back to a server, to save into Excel. The Excel file is created using the OpenXML libraries.

This should point you in the right direction.

Alternatively, you might like to try this library:

AlaSQL

(I haven't tried this though.)

Mike Gledhill
  • 27,846
  • 7
  • 149
  • 159
0

Try excelbuilderjs, I have done the same of downloading a Json Object with array of items into an excel sheet using this library.If you can please share the code on Jsfiddle, i can take a look at it and help you out

http://excelbuilderjs.com/

user3902443
  • 41
  • 1
  • 6
  • var testdata = [ ["fruits","frozen","fresh","rotten"], ["apples",884,494,494], ["oranges",4848,494,4949], ["kiwi",848,33,33] ]; //This is my javascript array I want to export it to xlsx – Atiq Shaikh Aug 20 '15 at 09:05