标签:
1 private void ToExcel(string html)
2 {
3
4 Response.ContentType = "application/force-download";
5 Response.AddHeader("content-disposition",
6 "attachment; filename=" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
7 Response.Write("");
8 Response.Write("
");9 Response.Write("");
10 string fileCss = Server.MapPath("~/UI/themes/DRP.UI.Ext.css");
11 string cssText = string.Empty;
12 StreamReader sr = new StreamReader(fileCss);
13 var line = string.Empty;
14 while ((line = sr.ReadLine()) != null)
15 {
16 cssText += line;
17 }
18 sr.Close();
19 Response.Write("");
20 Response.Write(" ");
35 Response.Write(html);//HTML
36 Response.Flush();
37 Response.End();
38 }
标签:
来源: https://www.cnblogs.com/maja/p/10231347.html