- Notifications
You must be signed in to change notification settings - Fork689
XLSXML
Mathias Rangel Wulff edited this pageJun 7, 2017 ·4 revisions
AlaSQL has XLSXML() export function with coloring functionality. The correct extension for the files is.xls.
vardata=[{city:"London",population:5000000},{city:"Moscow",population:12000000},{city:"Mexico",population:20000000},{city:"New York",population:20000000},];varopts={headers:true,column:{style:{Font:{Bold:"1"}}},rows:{1:{style:{Font:{Color:"#FF0077"}}}},cells:{1:{1:{style:{Font:{Color:"#00FFFF"}}}}}};alasql('SELECT * INTO XLSXML("restest280b.xls",?) FROM ?',[opts,data]);
Test this example inhttps://jsfiddle.net/vL4tsaef/1/
Here you can define style for any column, row, or cell in the sheet.
To write special character (like& , _ \) to the sheet name (sheetid) you need to escape in xml format. Example:http://jsfiddle.net/ry8fq0dL/125/
© 2014-2026,Andrey Gershun &Mathias Rangel Wulff
Please help improve the documentation by opening a PR on thewiki repo