0

I am exporting an array to xls using alasql. It seems header:true or header:false has no effect on showing or not showing the headers. In my case I want to show the headers, but I want them to be bold. This is what I am using, but it is not working. Can you give me some advice please?

data = [{enddata : "2016-07-12", lc-type : "Ingredient", order :"2057207"}, {enddata : "2016-07-12", lc-type : "Ingredient", order :"2057208"}];

var opts = [{sheetid:'LCList',header:true, column: {style:{Font:{Bold:"1"}}}}];
        var res = alasql('SELECT INTO XLSX("LCList.xlsx",?) FROM ?',[opts,[data]]);
S.vanNerum
  • 15
  • 1
  • 7

1 Answers1

0
  1. Your header:true should be headers:true

  2. Please avoid having the options in an array ([ and ])

  3. See working example of bold headers here: http://jsfiddle.net/78cdxfww/

mathiasrw
  • 610
  • 4
  • 10
  • The headers:true are working now :) I put the options in an array because in my example I also have multiple sheets, and each sheet has it's own options. I can not get the headers to be bold like in the jsfiddle example. – S.vanNerum Jul 13 '16 at 11:30
  • I think after opening the xls, it is trying to modify the layout, but has not enough permissions to do so...... I get error : run-time error '70': Permission denied. – S.vanNerum Jul 13 '16 at 11:54
  • So the file from the fsfiddle does not have bold headers when you open? – mathiasrw Jul 13 '16 at 12:26
  • in the jsfiddle example it has bold headers, and also no run-time error... – S.vanNerum Jul 13 '16 at 12:45
  • Then I suggest taking the example and shape it until it reflects your needs. – mathiasrw Jul 13 '16 at 13:40
  • @mathiasrw When saving as .xlsx file extension we don't see any styles getting applied. Is it a know issue or am I missing something? – Alvin Jun 19 '18 at 13:16