Creating a Mulit-Page Table

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

    Posted 03 Jun 2015 Link to this post

    Are there any examples of dynamically generating a PDF report that is essentially a formatted table containing data by looping through an object - using this new PdfProcessing control?  

  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 04 Jun 2015 Link to this post

    Hi Dan,

    All the demos available for the RadPdfProcessing library you could find here. A demo, demonstrating how to create a table from a set of objects is not present, but you could check the Table article in our documentation, where is explained how to create and modify such element. After getting familiar with the API, loop through the objects you want to fill the table with and add the values to the cells.

    for (int i = 0; i < people.Count; i++)
    {
        TableRow row = table.Rows.AddTableRow();
        row.Cells.AddTableCell().Blocks.AddBlock().InsertText(people[i].FirstName);
        row.Cells.AddTableCell().Blocks.AddBlock().InsertText(people[i].LastName);
        row.Cells.AddTableCell().Blocks.AddBlock().InsertText(people[i].Age.ToString());
    }

    Hope this helps.

    Regards,
    Tanya
    Telerik
  3. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 07 Jul 2015 in reply to Tanya Link to this post

    Thanks Tanya.  I am finally finding a minute to look at this. 

    If I take your example and put it in a loop for say 200 passes - the table rows just go off the first page.  Do I need to implement my own paging strategy for the data - or is there something I am missing here that can break a Table across multiple pages automatically?

  4. Dan
    Dan avatar
    124 posts
    Member since:
    Feb 2011

    Posted 07 Jul 2015 in reply to Dan Link to this post

    Nevermind - just realized I needed to use the RadFixedDocumentEditor.InsertTable to get that to work 
Back to Top