We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

PdfGrid Nested Tables

The documentation of the PdfGrid object states it supports drawing nested tables. However, I can't seem to find any examples showing how to do this. I need to create a table that has 7 columns for the header data. Then each row in this table may have detail data to be displayed as well. This is where the nested table comes into play. The real trick is if the header table or the detail table spill to the next page, the header table and detail table headings must print on the new page. Any help with this would greatly be appreciated.


2 Replies

VP Vinnie Pignataro February 24, 2012 06:27 PM UTC

I have found some sample logic under the PdfGridFormatting Cell section of the help file. At this point I think I am set. Basically you need to create another PdfGrid, and set the column value equal to the new grid to create a nested table.



GM Geetha M Syncfusion Team February 28, 2012 10:11 AM UTC

Hi Vinnie,

Thank you for your interest in Syncfusion products.

Yes. As you found out, the child grid should be assigned as the cell value. Following code snippet illustrates this:

PdfGrid childPdfGrid = new PdfGrid();
childPdfGrid.Columns.Add(5);
for (int i = 0; i < 5; i++)
{
PdfGridRow row = childPdfGrid.Rows.Add();
for (int j = 0; j < 5; j++)
{
row.Cells[j].Value = String.Format("Cell [{0} {1}]", j, i);
}
}

// Set the value as another PdfGrid in a cell.
parentGrid.Rows[0].Cells[1].Value = childPdfGrid;

You can get more information on this from the following documentation link:
http://help.syncfusion.com/Ug_101/Reporting/PDF/Windows%20Forms/default.htm#!documents/cell.htm

Please try this and let us know if you have any questions.

Regards,
Geetha



Loader.
Live Chat Icon For mobile
Up arrow icon