Posted on: 5/19/2011 2:37:01 AM | Views : 258

HI,
I have a datatable that contains html tags because. I try to export it  to excel, but also exports the html tags.
Like if I have for example '<b>226<b>' in my DataTable, when I export i to excel, I wish to see 226 in bold not '<b>226<b>' like it does actually.
The following is what I use to export to excel, my DataTable:
public static void ExportToSpreadsheet(DataTable table, string name) { HttpContext context = HttpContext.Current; context.Response.Clear(); foreach (DataColumn column in table.Columns) { context.Response.Write(column.ColumnName + ","); } context.Response.Write(Environment.NewLine); foreach (DataRow row in table.Rows) { for (int i = 0; i < table.Columns.Count; i++) { context.Response.Write(row[i].ToString().Replace(",", string.Empty) + ","); ...

Go to the complete details ...