0

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);

    }

Issue

divinediu
  • 423
  • 1
  • 9
  • 33
  • 1
    There are no iTextSharp classes visible in the code you show. Thus, no one can help yet. Most likely the actual iTextSharp objects and their uses are hidden in that `stringWrite` object and `getStringWriterbyDataTable` method. – mkl Apr 23 '14 at 11:49
  • 1
    For reference, those methods are from this earlier question: http://stackoverflow.com/q/23235519/231316 – Chris Haas Apr 23 '14 at 14:37

0 Answers0