Make data downloadable in Excel XLSX format.

Sheldon Livingston
Sheldon Livingston used Ask the Experts™
on
Is there a way to have data on a webpage downloaded in an xlsx file format?

Anything I see seems to do xls (in which Excel warns you about opening the file) or csv... which is non formatted, etc.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
If you can download it in xls file format you can then easily save it in xlsx format.
Ryan ChongSoftware Team Lead

Commented:
Make data downloadable in Excel XLSX format.
another way would be to create that Excel (xlsx) at server side and then stream it back to browser. that would also protect your data in some sense as you no need to store the data as a hyperlink in your web portal.
Chief Technology Ninja
Distinguished Expert 2018
Commented:
Hi Sheldon,

There are many ways you can go about it. I would list the one which I have heavily used over the period of years.
1. Open XML SDK - https://docs.microsoft.com/en-us/office/open-xml/open-xml-sdk - This is the one that I have used the most, It has a really difficult learning curve but if you want a sure shot solution, this is the way to go.
2. NPOI - https://github.com/tonyqus/npoi - This is a short cut and I have been using this library of late - and it serves the purpose most of the times.

There is another open source library which I have heard of but have never used in my mainstream engagements and that is https://github.com/JanKallman/EPPlus

Each of these libraries have sample code available which you can use to generate XSLX files.

Additionally, all of the above are non COM / non InterOP i.e. they are managed codes and you can use them with confidence (at least Open XML SDK).

Regards,
Chinmay.
Sheldon LivingstonConsultant

Author

Commented:
Thank you... I'm going to pursue the SDK.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Glad I could help. All the best.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial