private void ToExcel(string html)
{
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition",
"attachment; filename=" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
Response.Write("");
Response.Write("
");Response.Write("");
string fileCss = Server.MapPath("~/UI/themes/DRP.UI.Ext.css");
string cssText = string.Empty;
StreamReader sr = new StreamReader(fileCss);
var line = string.Empty;
while ((line = sr.ReadLine()) != null)
{
cssText += line;
}
sr.Close();
Response.Write("");
Response.Write(" ");
Response.Write(html);//HTML
Response.Flush();
Response.End();
}