Can you show the code, So that it will be easy to figure the problem.
But, While creating worksheet have you specified,
useStyles: true
var workbook = new Excel.stream.xlsx.WorkbookWriter({
filename: filename.xlsx,
useStyles: true
});
See below code, If it could be of any help -
var worksheet = workbook.addWorksheet(date);
worksheet.columns = [{
header: 'Col-1',
key: 'col_1',
width: 5
},
{
header: 'Col-2',
key: 'col_2',
width: 5
},
];
for (let i in data) {
worksheet.addRow(data[i]);
}
// set style for each cell
worksheet.eachRow(function (Row, rowNum) {
Row.eachCell(function (Cell, cellNum) {
if (rowNum == 1) {
Cell.alignment = {
vertical: 'center',
horizontal: 'center'
}
}else{
Cell.alignment = {
vertical: 'middle',
horizontal: 'middle'
}
}
})
})
workbook.commit()
.then(function () {
console.log('Excel export complete!');
process.exit()
});