This is a migrated thread and some comments may be shown as answers.
Creating a Mulit-Page Table
3 Answers 34 Views
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 04 Jun 2015, 01:17 AM

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?  

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 04 Jun 2015, 03:20 PM
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
0
Dan
Top achievements
Rank 1
answered on 07 Jul 2015, 09:20 PM

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?

0
Dan
Top achievements
Rank 1
answered on 07 Jul 2015, 09:27 PM
Nevermind - just realized I needed to use the RadFixedDocumentEditor.InsertTable to get that to work 
Asked by
Dan
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Dan
Top achievements
Rank 1
Share this question
or