How to get data with table formate in pdf

Jun 17 2016 9:13 AM
my code is
StringBuilder sb = new StringBuilder();    
sb.Append("<table border="1">");
sb.Append("<tr>");

sb.Append("</tr>");
foreach (DataGridViewRow row in dgv.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
sb.AppendFormat("<tr>");
sb.AppendFormat("<td>");
sb.Append(cell.Value);
sb.AppendFormat("</td>");
sb.AppendFormat("</tr>");
} } sb.Append("</table>"); return sb.ToString();

Answers (1)