I have a datatable
that I need to iterate row-wise and print it using iTextSharp in ASP.NET using C#.
For each row retrieved in parent datatable
dt, I print a child table dt_child. The dt_child is being printed perfectly. But the rows of parent dt are not printed in table fashion.
I am currently using the code specified below. But I need better code. As the dt isn't being displayed properly.
foreach (DataRow dr in dt.Rows)
{
//The way I print the dt row needs to be changed
foreach (DataColumn dc in dt.Columns)
{
stringWrite.Write(dr[dc]);
}
//Code Below this works perfectly
key=dr["key"].ToString();
dt_child = getDataTablebyProcedure("ChildProcedure",key);
stringWrite = getStringWriterbyDataTable(dt_child, stringWrite);
}