CYJS includes all the necessary to dynamically generates Excel files.
You will be able to easily convert a Javascript object array into a XLSX file. PHP script is provided to show you how to use, based on PHPExcel library.
In the demo, check the CYJS Tables page, then you’ll see that the last table is the real Linux process table generated on demand, once there click on the Excel icon panel top right to generate an Excel file with these data.

Javascript part : var webservice = cyServerName + cyPath + cyWebSvc +"?r=readprocess"; CYExec( { url: webservice, sync: false, callbackok: function(ret, status) { if (ret < 0) var process = new Object(); else var process = JSON.parse(ret); CYDataTable("IDtableusers5", { columns: pcolumns, data: process }, true); // Excel export $("#IDexcel1").show().on("click", function () { var webservice = cyServerName + cyPath + cyWebSvc; CYURL(webservice, { data: { r: "json2excel", header: "user;pid;cpu;mem;vsz;rss;tty;stat;start;time;command", lines: JSON.stringify(process), download: "process.xlsx" } }); }); } }); HTML part : <div class="ClassPanel"> <l> Simple real live process table </l> <div class="ClassPanelIconsRight"> <i title="Excel export" id="IDexcel1" class="fa fa-file-excel-o" style="cursor: pointer; display: none"></i> </div> </div> <div class="ClassDivTable"> <table class="ClassDataTable" id="IDtableusers5" data-page-length='5' data-paging='true' data-searching='true' data-ordering='true' data-info='true' data-order='[[ 0, "asc" ]]' data-selectauto='false' data-selectcolumns='true'> <thead> <tr> <th> user </th> <th> pid </th> <th> cpu </th> <th> mem </th> <th> vsz </th> <th> rss </th> <th> tty </th> <th> stat </th> <th> start </th> <th> time </th> <th> command </th> </tr> </thead> <tbody> </tbody> </table> </div>
On that example, the Excel icon is hidden by default, then if the webservice is successful for process loading it will be showed.
A click on it will then call another webservice to generate the corresponding XLSX file.