Repeat Table Heading after page break

4 posts, 0 answers
  1. Dan
    Dan avatar
    131 posts
    Member since:
    Feb 2011

    Posted 27 Jul 2015 Link to this post

    Is there any way to reprint the table's first row (header row) after each page break?  Currently we are using .InsertTable to handle tables that may span multiple pages.
  2. Petya
    Petya avatar
    983 posts

    Posted 28 Jul 2015 Link to this post

    Hi Dan,

    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.

  3. Dan
    Dan avatar
    131 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2016 in reply to Petya Link to this post

    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 .... ?

  4. Deyan
    Deyan avatar
    158 posts

    Posted 23 Mar 2016 Link to this post

    Hello Dan,

    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.

    the Telerik team
Back to Top