How to export multiple pivot-grid into single pdf file

We are loading multiple pivot-grid at the same component in Angular. So, we need to export(PDF) all these grids in one pdf file. How to achieve this?
 
I have tried the following, but couldn’t get it. Please reply asap.
  
exportPDF(){
var doc=newjsPDF(‘l’, ‘pt’);
let docList= [];
// ‘multi_pivotGrid’ holds many flexmonster pivot-grid.
for (leti=0; i<multi_pivotGrid.length; i++) {
let flexmonster=multi_pivotGrid[i].flexmonster;
flexmonster.exportTo(“pdf”, { destinationType:”plain” }, function (res) {
var pdf=res.data;
docList.push(pdf);
doc=Object.assign({}, doc, pdf); // Didn’t worked.
if (multi_pivotGrid.length==docList.length) {
doc.save(“AllPivotGrids_pdf”); // Here, we need actual flexmonster ‘doc’
}
else
doc.addPage();
});
}
}

Attachments:
PDF_multi-pivot.PNG

1 answer

Public
Tanya Gryshko Flexmonster January 4, 2019

Hello, Abu,
Thank you for writing to us.
Please have a look at the following JSFiddle example: https://jsfiddle.net/flexmonster/82vt1y0z/. It shows how to export two pivot instances to one PDF file. The same approach can be applied to multiple instances as well.
Please inform me if it helps.
Regards,
Tanya

Please login or Register to Submit Answer