首页 > Windows开发 > 详细

C# html table转excel

时间:2019-02-22 10:54:54      阅读:358      评论:0      收藏:0      [点我收藏+]

1.

 1         protected void ebtDC_Click(object sender, EventArgs e)
 2         {
 3 
 4             string elxStr = "<table><tbody><tr><td>1</td><td>11</td></tr><tr><td>2</td><td>22</td></tr></tbody></table>";
 5             Response.Clear();
 6             Response.Buffer = true;
 7             Response.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("yyyyMMdd") + ".xls");
 8             Response.ContentEncoding = System.Text.Encoding.UTF8;
 9             Response.ContentType = "application/vnd.ms-excel";
10             Response.Write(elxStr);
11             Response.End();
12         }

如果是身份证  string.Concat("‘", dt.Rows[i]["CardNum"].ToString())

C# html table转excel

原文:https://www.cnblogs.com/chenze-Index/p/10416770.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!