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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Nested Tables Support

Thread ID:

Created:

Updated:

Platform:

Replies:

82540 Jun 15,2009 01:44 PM UTC Jul 10,2009 10:42 AM UTC WinForms 5
loading
Tags: PDF
Steve Platz
Asked On June 15, 2009 01:44 PM UTC

Is it possible to use nested tables with Syncfusion.Pdf? I have looked through the documentation and could not find anything. Additionally, I tried some things on my own, but when the table was rendered, the cell I was expecting a nested table to be in instead had "Syncfusion.Pdf.Tables.PdfLightTable" in it.

Simplified, here is the code I used:

PdfLightTable outerTable = new PdfLightTable();
outerTable.DataSourceType = PdfLightTableDataSourceType.TableDirect;

outerTable.Columns.Add(new PdfColumn("Column 1"));
outerTable.Columns.Add(new PdfColumn("Column 2"));

PdfLightTable innerTable = new PdfLightTable();
innerTable.DataSourceType = PdfLightTableDataSourceType.TableDirect;

innerTable.Columns.Add(new PdfColumn("Column 1"));
innerTable.Columns.Add(new PdfColumn("Column 2"));

innerTable.Rows.Add(new object[] { "Cell 1.1", "Cell 1.2" });

outerTable.Rows.Add(new object[] { "Cell 1", innerTable });

Sri Subhashini M [Syncfusion]
Replied On July 6, 2009 11:01 AM UTC

Hi Steve,

Thank you for your interest in Essential PDF.

Nested Table

We can draw the table inside to another table by subscribing BeginCellLayout event handler.

Kindly refer the below code snippet to render the nested table,

// Event handler
table.BeginCellLayout +=new BeginCellLayoutEventHandler(table_BeginCellLayout);


void table_BeginCellLayout(object sender, BeginCellLayoutEventArgs args)
{
if (args.CellIndex == 2 && args.RowIndex == 1)
{
DataTable dt = new DataTable();
dt.Columns.Add("Column 1");
dt.Columns.Add("Column 2");

dt.Rows.Add(new string[] { "Cell 1.1", "Cell 1.2" });
dt.Rows.Add(new string[] { "Cell 2.1", "Cell 2.2" });

PdfLightTable t1 = new PdfLightTable();
t1.DataSourceType = PdfLightTableDataSourceType.External;
t1.DataSource = dt;

t1.Draw(args.Graphics, args.Bounds.Location,args.Bounds.Width);
}
}

Please do find the sample from the below specified location and let me know if this helps,

http://files.syncfusion.com/samples/pdf.windows/PDF_F82540.zip

Regards,
Suba

Steve Platz
Replied On July 8, 2009 02:12 PM UTC

That worked great for inserting a table in that cell, but now I'm running into the problem of the cell not growing in height to fit the contents of the nested table. I looked at the example you attached and it seemed the case was the same there as well. Is this possible?

Steve Platz
Replied On July 8, 2009 02:13 PM UTC

I also meant to add that the nested table has its contents spill over into the adjacent cells, causing things to render incorrectly.

Steve Platz
Replied On July 8, 2009 02:30 PM UTC

Better yet, is there a way to do row spans at all? I've found column spans in the documentation, but no mention of row span.

Sri Subhashini M [Syncfusion]
Replied On July 10, 2009 10:42 AM UTC

Hi Steve,

Sorry for the delay in getting back with you.

Nested Table and RowSpan feature

We can draw the nested table and set the row span easily by using PdfGrid method and the Pdfgrid feature is available with our latest Essential Studio 2009 Volume.3 RC. This is available for download from the below location.

http://www.syncfusion.com/support/forums/general/86322/essential-studio-2009-vol3-rc-v73018-available-for-download

Could you please do find the sample which demonstrates the above mentioned feature and let me know if this helps?
http://files.syncfusion.com/samples/PDF.Windows/F82540.zip

Regards,
Suba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;