Hack Forums
[Javascript] NPM package for Excel downloads - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [Javascript] NPM package for Excel downloads (/showthread.php?tid=6056894)



NPM package for Excel downloads - bevc - Mar 14, 2020

I've programmed an application in Node, Mongo, Express etc, and I need to allow users to download an excel report from it. I found a neat NPM package called node-excel-export which seemed to be exactly what I wanted, I installed it and wrote my function, but......

Now I've realised that I don't think it's quite right for what I'm doing. Although it lets you set the styles and all that, in seems quite limited in how it lets you manipulate data. I have 3 or 4 'datasets' that I need to include on the report, and this package only seems to allow one (an array of objects).

I could just smoosh all the data together 'laterally', but I really don't want to do that, because it would look weird.

There seem to be a few different options kicking around for npm packages, or for doing it with client side JS. I was hoping that somebody on here might have some experience with doing this and some advice to offer, rather than me spending the next week experimenting - does anyone know of a package that might do what I need, allow me to create an excel download where I have a reasonable level of control of the layout of the sheet?

Thanks.


RE: NPM package for Excel downloads - ~Dec - Mar 15, 2020

Most use cases can be covered by just exporting data in CSV format and reading that into Excel/Google Sheets. If you want to customize actual Excel worksheets with styling, formatting, etcetera then you can use https://www.npmjs.com/package/exceljs

This tutorial is easy to follow: https://spin.atomicobject.com/2018/11/28/nodejs-excel-file-generation/