|
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;
}
}
} |
Hi Sowmiya,
The problem is solved. Thanks for the assistance.
Best Regards.