// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number") { Width = 80 });
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding Rows
table.Rows.Add(new object[] { "111", "test", "test" });
PdfLightTable table = new PdfLightTable();
// Set the DataSourceType as Direct
table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
table.Style.DefaultStyle.BorderPen = new Syncfusion.Pdf.Graphics.PdfPen(Syncfusion.Drawing.Color.Red);
// Creating Columns
table.Columns.Add(new PdfColumn("Roll Number") { Width = 80 });
table.Columns.Add(new PdfColumn("Name"));
table.Columns.Add(new PdfColumn("Class"));
// Adding Rows
table.Rows.Add(new string[] { "111", "test", "test" });
// Adding Rows
table.Rows.Add(new string[] { "111", "test", "test" });
// Adding Rows
table.Rows.Add(new string[] { "111", "test", "test" });
// Adding Rows
table.Rows.Add(new string[] { "111", "test", "test" });
table.Draw(page,new RectangleF(0,0,500,500));
The sample project is attached for your reference.
http://www.syncfusion.com/downloads/support/forum/120264/ze/PdfTableCreation1240925891.zip
Please try this and let us know the result.
With Regards,
Praveen
Hi Wes,
Thank you for your update. We are glad to know that our solution helped.
Please let us know if you have any other queries.
Regards,
Chinnu