-
Notifications
You must be signed in to change notification settings - Fork 666
XLS
Mathias Rangel Wulff edited this page Jul 11, 2015
·
10 revisions
AlaSQL can read and export data in Excel 2003 format (.xls) with coloring of cells.
var opts = {
headers: true,
sheetid: 'My Birds',
style:"background:#00ff00",
columns: [
{columnid:'a',title:'Albatroses',
style:'background:red;font-size:20px',
cell:{style:'background:blue'}
},
{columnid:'b',title:'Bird',cell:{
style:function(value,sheet,row,column,rowidx,columnidx){
return 'background'+(value==10?'brown':'white')
}}},
{
columnid: 'b', cell:{value:function(value){ return value * value}}
}
]
};
var res = alasql('SELECT * INTO XLS("restest257a.xls",?) FROM ?',[opts,data]);
Please, see the example with advanced color syntax in jsFiddle.
If you need Excel 2007 files please check out XLSX
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo