市长热线演示版

callplantaskresultdataexcel.aspx.cs 1.0KB

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. namespace HySoft.BaseCallCenter.Web.calloutmanage
  8. {
  9. public partial class callplantaskresultdataexcel : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. }
  14. protected void exportExcel_Click(object sender, EventArgs e)
  15. {
  16. string fileName = "回访报表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
  17. Response.Clear();
  18. Response.Charset = "GB2312";
  19. Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
  20. Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName));
  21. Response.ContentType = "application/ms-excel";
  22. Response.Write("<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=gb2312\"/>" + this.htHtmlReport.Value);
  23. Response.End();
  24. }
  25. }
  26. }