- Home
- Forum
- Xamarin.Forms
- Syncfusion.Pdf.Tables.PdfLightTableException: End column index is less than start column index.
Syncfusion.Pdf.Tables.PdfLightTableException: End column index is less than start column index.
Hello
Im trying to reproduce the example in "Working with Tables" described here:
https://help.syncfusion.com/file-formats/pdf/working-with-tables#creating-a-simple-table
but Im getting this error when it gets to the pdfLightTable.Draw part:
Syncfusion.Pdf.Tables.PdfLightTableException: End column index is less than start column index.
Best Regards.
SIGN IN To post a reply.
3 Replies
SL
Sowmiya Loganathan
Syncfusion Team
November 6, 2017 01:01 PM UTC
Hi Ara,
Sorry for the inconvenience caused,
The DataTable is not supported as data source in PDF light table in Xamarin forms platform. We suggesting you to use IEnumerable as Data source in Xamarin forms as provided in the code snippet. Please find the below code snippet for more details :
|
void DrawTable()
{
//List of Columns
List<Customer> collection = new List<Customer>();
Customer customer = new Customer();
//Add Row values
customer.Name = "Jhone";
customer.RollNumer = "44";
customer.Class = "A";
//Add Row values
collection.Add(customer);
customer = new Customer();
customer.Name = "whell";
customer.RollNumer = "43";
customer.Class = "B";
//Add Row values
collection.Add(customer);
customer = new Customer();
customer.Name = "Andrew";
customer.RollNumer = "48";
customer.Class = "C";
collection.Add(customer);
// Create a PdfLightTable.
PdfLightTable pdfLightTable = new PdfLightTable();
pdfLightTable.Style.ShowHeader = true;
//Assign data source.
pdfLightTable.DataSource = collection;
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(30, 70));
}
private class Customer
{
private string m_name;
private string m_roolNumber;
private string m_class;
public string Name
{
get
{
return m_name;
}
set
{
m_name = value;
}
}
public string RollNumer
{
get
{
return m_roolNumber;
}
set
{
m_roolNumber = value;
}
}
public string Class
{
get
{
return m_class;
}
set
{
m_class = value;
}
}
} |
Please try this in your end and let us know if it solves your issue.
Regards,
Sowmiya L
AR
ara
November 6, 2017 06:21 PM UTC
Hi Sowmiya,
The problem is solved. Thanks for the assistance.
Best Regards.
SL
Sowmiya Loganathan
Syncfusion Team
November 7, 2017 06:13 AM UTC
Hi Ara,
We are glad to know that your issue has been resolved.
Regards,
Sowmiya L
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AR ara
- Nov 3, 2017 03:38 PM UTC
- Nov 7, 2017 06:13 AM UTC