`
for (let index = 1; index < res.reportData.length; index++) {
var doc = new jsPDF('p', 'pt');
let finalY = doc.autoTable.previous.finalY;
doc.autoTable(columns, res.reportData[index].dataValues, {
styles: {fillColor: [100, 255, 255]},
pageBreak: 'always',
columnStyles: {
id: {fillColor: 255}
},
margin: {top: 60},
addPageContent: function(data) {
doc.text(res.reportData[index].sensorName, 40, finalY+30);
}
});
sensorName = res.reportData[index].sensorName+'_report';
}
doc.save(sensorName+'.pdf');
only displays last table ..... i don't know exactly how much data ..... tested with one table table son data works fine ..... once data is of more table overrides and displays only last table
仅显示最后一个表.....我不知道确切多少数据...用一个表测试过的子数据工作正常...一旦数据被更多表覆盖并仅显示最后一张桌子
`