I wanna write an export with more than one sheet:
// Create a new Excel file with a default font and colour
var excel = $JExcel.new("Calibri 12 #333333");
// Add a new sheet with a name
excel.set( { sheet:0, value:type0 });
// Add a new sheet with a name
excel.set( { sheet:1, value:"res" });
The last line I got the following message:
Script Error: javax.script.ScriptException: Bad sheet 1 in file: [..]lib/myexcel.js at line number 210 at column number 28
What's wrong?
I looked at the source code for myexcel.js and found that you have to add the sheet like this:
excel.addSheet("res");
It seems a new Excel object adds one sheet by default (0) so the call to set is only setting its name.
Thanks.
That means: the first one is still existing by creating JExcel.new, so I just have to give them a name.