3 Answers, 1 is accepted
The RadPdfProcessing library doesn't provide such option, but it sounds as a nice idea.
I logged this in our backlog and updated your Telerik points in appreciation of the suggestion. You can track the availability of the functionality in the public portal: Implement Table Repeat Header Row.
Regards,
Petya
Telerik
We are very much looking forward to the addition of this feature in the near future.
And thank you for the workaround code sample. We have been working through but seem to be stuck - and are hoping perhaps you can suggest a another workaround while we wait for this feature:
The sample code in that link assumes that you are just printing a single table across multiple pages, starting at the top of the first page. The scenario gets much more complicated when you have content before the table or multiple tables in a report - where a table does not necessarily start at the top of a page.
The workaround then would seem to be to print the header row along with the data in the initial .InsertTable - then loop through all of the pages after the first and re-insert the header. Trouble is - how do you set the Top Margin on subsequent pages of an .InsertTable to be greater than the first page? Seems that we have the cart before the horse here - not sure how to do this .... ?
Thank you for contacting us.
The desired scenario cannot be achieved by using the RadFixedDocumentEditor class as it renders the pdf content sequentially and you cannot set different page margins on different pages. However, RadFixedDocumentEditor internally uses the FixedContentEditor to measure, position and draw the elements. So in order to achieve your custom scenario you may try using FixedContentEditor as well.
I am attaching a demo project demonstrating how to draw a paragraph and then a table with repeating header row. A few words about this project:
- It is a console application.
- The demo generates a big paragraph represented by a Block class instance.
- Using FixedContentEditor the paragraph is drawn and split onto multiple pages.
- Then again using FixedContentEditor Draw method a long Table is drawn and split onto multiple pages.
- Another Table is used to draw a repeating header row on each page just before drawing the long table content.
- Both Block and Table classes implement IBlockElement interface which allows you to Measure, Draw and Split them and get their DesiredSize after the last Draw/Measure method call. You may find more information about this interface in this forum post and this forum post as well.
- As a result when you run the demo you may see the exported document with a paragraph split onto pages and a table with repeating header row that begins right after the paragraph.
I hope this is helpful. If you have any other questions or concerns please do not hesitate to contact us again.
Regards,
Deyan
the Telerik team