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

2 Answers 2

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.)

Sign up to request clarification or add additional context in comments.

Comments

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/

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.