- Home
- Forum
- Xamarin.Forms
- PdfTableLight cannot set custom rows and columns
PdfTableLight cannot set custom rows and columns
// 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" });
Thank you for using syncfusion products,
We are currently looking into this odd behavior, however we are suggesting you to use without “table.DataSourceType = PdfLightTableDataSourceType.TableDirect;”. We will update you the further full details on 18 September 2015.
With Regards,
Praveen
Thank you for your patience,
We are suggesting you to use the following code to create a direct table
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
- 4 Replies
- 3 Participants
-
WE Wes
- Sep 15, 2015 08:51 PM UTC
- Sep 23, 2015 04:55 AM UTC