router.get('/excel', function (req, res) {
var conf ={};
conf.cols = [
{caption:'用户ID', type:String},
{caption:'被约数', type:String},
{caption:'发约数', type:String}
];
conf.rows = [
['fff','9','1']
];
var result = nodeExcel.execute(conf);
console.log(result); // 这个的输出是乱码,所以excel也是打不开的
res.setHeader('Content-Type', 'application/vnd.openxmlformats');
res.setHeader("Content-Disposition", "attachment; filename=" + "Report.xlsx");
res.end(result, 'binary');
});
求大侠指教