var excel = require('excel4node');
var workbook = new excel.Workbook();
var worksheet = workbook.addWorksheet('Report 1');
var worksheet2 = workbook.addWorksheet('Report 2');
var style = workbook.createStyle({
font: {
color: '#FF0800',
size: 12
},
numberFormat: '$#,##0.00; ($#,##0.00); -'
});
worksheet.cell(2,1).string('string').style(style);
var complexString = [
'default font String\n',
{
bold: true,
underline: true,
italic: true,
color: 'FF0000',
size: 18,
name: 'Courier',
value: 'Hello..'
},
' World!!!',
{
color: '000000',
underline: false,
name: 'Arial',
vertAlign: 'subscript'
},
' All',
' these',
' strings',
' are',
' black subsript,',
{
color: '0000FF',
value: '\nbut',
vertAlign: 'baseline'
},
' now are blue'
];
worksheet.cell(4, 1).string(complexString);
worksheet.cell(5, 1).string('simple string').style({ font: {name: 'Helvetica'} });
workbook.write('report.xlsx');
var fs = require('fs');
fs.readdir('.', function(err, items) {
console. log(items);
});