HttpResponse resp = System.Web.HttpContext.Current.Response;
resp.Charset = "utf-8";
resp.Clear();
resp.AppendHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
resp.ContentEncoding = System.Text.Encoding.UTF8;
resp.ContentType = "application/ms-excel";
string style ="<meta http-equiv=/"content-type/" content=/"application/ms-excel; charset=utf-8/"/>"+ "<style> .table{ font: 9pt Tahoma, Verdana; color: #000000; text-align:center; background-color:#8ECBE8; }.table td{text-align:center;height:21px;background-color:#EFF6FF;}.table th{ font: 9pt Tahoma, Verdana; color: #000000; font-weight: bold; background-color: #8ECBEA; height:25px; text-align:center; padding-left:10px;}</style>";
resp.Write(style);
//resp.Write(ExportTable(list));
resp.Write("<table class='table'><tr><th>" +"手机"+ "</th><th>" + "渠道" + "</th><th>" +"时间" + "</th></tr>");
//dbVideoList = (List<subShiyongModel>)Session["dbVideoList"];
foreach (bUFlow.Model.orderhistory model in orderlist)
{
resp.Write("<tr><td>" + model.phone + "</td>");
resp.Write("<td>" + model.qudao + "</td>");
resp.Write("<td>" + model.tm + "</td>");
resp.Write("</tr>");
}
resp.Write("<table>");
resp.Flush();
resp.End();
}
新闻热点
疑难解答