Is it possible to export a master-detail grid to PDF? I've been able to do it in excel with your examples but haven't figured out how to do it with PDF. Also when is pdfExport event emitted? I'm calling grid.saveAsPDF() but the event doesn't seem to be emitted.
Thanks in advance!
1 Answer, 1 is accepted
0
Hetali
Telerik team
answered on 13 Jun 2022, 08:17 PM
| edited on 15 Jun 2022, 05:31 PM
Hello Arnþór,
The PDF Export of the Kendo UI Master-Detail Grid is not supported as mentioned in the known limitations. However, by expanding all the rows of the Master-Detail Grid, the Grid can be exported to PDF using the Kendo UI PDF Export component. The following custom function can help you achieve that:
In this StackBlitz example, I have expanded all the rows and exported the Master-Detail Grid to the PDF. Please note that the large data set of the Grid can cause performance issues and out-of-memory errors.
Thanks for the quick reply that's good to know! Is it on the roadmap to add this feature?
Maybe the wording in known limitations might be improved to mention master-detail to eliminate confusion?
Regarding the event I would have assumed that excelExport and pdfExport would be emitted in a similar fashion and it seems that excelExport is emitted when grid.saveAsExcel() is called.
Since the PDF is a drawing I guess you could solve this by expanding all the rows of the grid before calling grid.saveAsPDF() is that assumption correct and if so is there an easy way to expand all rows?
Best, Arnþór
Hetali
Telerik team
commented on 15 Jun 2022, 05:33 PM
Hi Arnþór,
The PDF Export of the Master-Detail Grid is not on the roadmap as it is a limitation. We are currently working on the Angular documentation, and I have let the team know to modify the limitation content to be more specific.
The excelExport event is emitted when the saveAsExcvel method is called so that the developer can customize the workbook of the ExcelExportEvent before exporting the file. In case of the pdfExport event, the developer can only prevent exporting the file by using the preventDefault method of the PDFExportEvent. This prevention can also be accomplished without the need of handling the pdfExport event, which is why is not fired during the saveAsPDF method.
Please take a look at the modified answer to export the Master-Detail Grid in PDF after expanding all the rows.