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.
Unfortunately, activation email could not send to your email. Please try again.

PdfTableLight cannot set custom rows and columns

Thread ID:

Created:

Updated:

Platform:

Replies:

120264 Sep 15,2015 04:51 PM Sep 23,2015 12:55 AM Xamarin.Forms 4
loading
Tags: PDF
Wes
Asked On September 15, 2015 04:51 PM

Hello,

I'm having an issue creating custom rows and columns using the PdfTableLight APIs.

I'm doing the following and my row headers are showing but no rows are getting added. It works if I don't use TableDirect. Am I doing something wrong?

// 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" });



Praveenkumar H [Syncfusion]
Replied On September 16, 2015 09:21 AM

Hi Wes,

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

Praveenkumar H [Syncfusion]
Replied On September 18, 2015 03:18 AM

Hi Wes,

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


Wes
Replied On September 22, 2015 07:49 AM

Praveen, thanks for the response. Using strongly typed strings does in fact cause the rows to be created. This should unblock me for now, thanks!

Chinnu Muniyappan [Syncfusion]
Replied On September 23, 2015 12:55 AM

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


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.

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.

;