i am using below code for export to excel for simple html table(not using gridview or any other reporting panel or control,it is simple html table).
public void ExportToExcel(ref string html, string fileName)
{
html = html.Replace(">", ">");
html = html.Replace("<", "<");
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fileName + "_" + DateTime.Now.ToString("M_dd_yyyy_H_M_s") + ".xls");
HttpContext.Current.Response.ContentType = "application/xls";
HttpContext.Current.Response.Write(html);
HttpContext.Current.Response.End();
}
Issue:
i am applying css property of text-transform on username to capitalize it. it is showing proper titlecase on web. but when i export my html table to excel.it is showing lowercase username.
like
.titlecase{
text-transform:capitalize;
}
example td:
<td class="titlecase"> kethrine </td>
Need Solution for:
I need solution which helps that
when i export my html table to excel , my text-trasform:capitalize property should be applied and my text should be in title case in excel.
i can explain more in case of any concern.
Thank you in advance.