Please see
http://excelbuilderjs.com[
^].
This is another alternative:
https://github.com/SheetJS/js-xlsx[
^].
I don't feel like doing it in JavaScript is a good idea. It could require too much effort, not so easy to debug, all code is exposed to the anyone on the Web, and so on. Doing it on the server side, using one or another server-side technology would be much more reasonable task. And it would be especially natural to do in .NET, because you could use Microsoft Open XML SDK, so ASP.NET would be the most suitable server-side technology.
—SA