You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to create multiple worksheets into a workbook?
This is how to prepare a single sheet of data.
vardata=[];alasql('SELECT * INTO XLSX ("mydata.xlsx", { headers:true }) FROM ?',data);
To export multisheet workbook use this code:
vardata1=[{a:1,b:10},{a:2,b:20}];vardata2=[{a:100,b:10},{a:200,b:20}];varopts=[{sheetid:'One',header:true},{sheetid:'Two',header:false}];varres=alasql('SELECT INTO XLSX("restest344b.xlsx",?) FROM ?',[opts,[data1,data2]],function(){done();});
Please note, that by some reason AlaSQL uses this syntax SELECT FROM without star inside. This syntax is equvalent to SELECT COLUMN _ FROM, that different from SELECT * FROM, because second syntax creates new objects on the base of data.