0

我需要将数据透视表导出为 PDF,并在标题处包含多行。问题是它总是打印一个标题,而实际上我需要更多。

有一个带有当前表数据透视表的图像要导出。现在导出的 PDF 看起来像这个pdf 导出的。

你可以看到它与原来的不一致,这是我到目前为止的代码:

function ExportPdf()
			{				
			  var pdfsize = 'a0';
			  var pdf = new jsPDF('l', 'pt', pdfsize);

			  var res = pdf.autoTableHtmlToJson(document.getElementsByClassName("pvtTable")[0]);
			  console.log(res.columns);
			  console.log(res.data);
			  pdf.autoTable(res.columns, res.data, {
			  //pdf.autoTable({
				startY: 60,
				tableWidth: 'auto',
				columnWidth: 'auto',
				styles: {
				  overflow: 'linebreak'
				}
			  });

			  pdf.save(pdfsize + ".pdf");

			}

我看到的问题是 autotable 正确地考虑了第一行,但不是其他行。它没有考虑枢轴进行的分组。有人可以解决这个问题。

4

0 回答 0