Exporting grid with hierarchical data into PDF

2 Answers 311 Views
Grid
Marc-Arthur
Top achievements
Rank 1
Iron
Marc-Arthur asked on 29 Jul 2022, 01:15 PM | edited on 29 Jul 2022, 01:15 PM

Hello,

I looked in this forum for hints on how to export a grid that contains a hierarchical report data into PDF so the report can be printed. But I have not ran into any definitive information on the topic. I have seen some limitations. Can this be done? I tried to research the reporting capabilities of Progress but its seems that the reporting function is a .Net solution and there is not a solution for other platforms like Nodejs.

So my question is twofold:

1. How can I export hierarchical data into PDF?
2. If that is not doable, is there a non .Net reporting solution for platforms like Nodejs.

Would appreciate any pearl of wisdom I can garner from this august body.

2 Answers, 1 is accepted

Sort by
0
Accepted
Marc-Arthur
Top achievements
Rank 1
Iron
answered on 01 Aug 2022, 08:27 AM
Regretably, I have to say that this aspect of Telerik Kendo is pretty crappy. Obviously not too many people are interested in answering this question. I ended up creating a manual report with the JSON file. Then I discovered jspdf and jspdf-autotable that allow you to make a PDF with flat JSON files. I had to massage the hierarchy a little bit and that was not bad since it was only 2 levels. No more messing with fonts and Unicode. This experience with Kendo left a raw taste in my mouth. 
0
Nikolay
Telerik team
answered on 03 Aug 2022, 10:37 AM

Hello Marc-Arthur,

Exporting a hierarchical Grid is generally not supported out of the box and this is documented in the "Known limitations" article for the PDF export:

The problem with the hierarchy is the sequence of the events and the async requests for the data when server operations are enabled. For exporting all nested in the detail templates Grids and changing their page size you could use a custom button, request all records for the parent Grid, expand all records within its dataBound event, change the page size for the nested Grids and only afterward when the entire DOM is rendered, export the parent Grid to PDF.

Another solution would be to allow the user to choose if they want to export all rows for the master and the child grid and if so, you could have a custom button that could request and render all master and detail rows before the user clicks on the export button.

I prepared a small Dojo example that exports the current Grid page. You can expand the master rows you want to export and click on the export button. 

I hope this answers the question.

Regards,
Nikolay
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Marc-Arthur
Top achievements
Rank 1
Iron
commented on 06 Aug 2022, 07:11 PM

Hi Nikolay,

 

Thanks for your answer. I will take a look at what you have and revert back to you. Thanks for the time.

 

Marc-Arthur

Tags
Grid
Asked by
Marc-Arthur
Top achievements
Rank 1
Iron
Answers by
Marc-Arthur
Top achievements
Rank 1
Iron
Nikolay
Telerik team
Share this question
or