PDFExport component need to add multiple sub headers inside table and repeat Sub Header after new page.

1 Answer 87 Views
PDF Processing
Mehar
Top achievements
Rank 1
Mehar asked on 04 Jan 2022, 01:50 PM

Need to add sub header after table data overflows to next page.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 04 Jan 2022, 02:49 PM

Hello Mehar,

The GridPDFExport has "repeatHeaders" property which will determine whether or not the header row will be rendered for each page:

Here is an example that exports multiple pages with repeatHeaders enabled:

You can also user the pageTemplate for adding custom content per page.

If you have something different in mind, please do not hesitate to contact us again.

 

Regards,
Konstantin Dikov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Mehar
Top achievements
Rank 1
commented on 05 Jan 2022, 06:16 AM

Hi Konstantin Dikov,

Thank you for your suggestion. Here the issue is different am having multiple CATEGORY having multiple SUBCATEGRIES. While exportPDF, The table Category contains more than 15 Subcategories records, In the New page will adding the SubCateories without adding Category. We need the functionality like have to add the Category name on top of SubCategory(It will be having inside <td></td> not the <thead></thead>).
I am attaching the screen as well, Can you please give a suggestion on this.
Konstantin Dikov
Telerik team
commented on 05 Jan 2022, 09:53 AM

Since the repeatHeaders functionality works by repeating the THEAD element of the table and due to the fact that there could be only one THEAD, the requirement that you have could not be achieved. This is the main reason why exporting hierarchical Grid is not support scenario. 

The only solution that I could suggest is to render different structure when you need to export to PDF and generate multiple table elements for each subcategory table and use the PageTemplate to add the main category header manually. Then, you can use the "save" method callback function (which will be called after the export is finished), to change the rendering to the hierarchical one. Another option is to keep the default rendering, but create a separate element on the page just for the export and remove it after the export is finished.

Tags
PDF Processing
Asked by
Mehar
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or