市长热线演示版

YearContrast.aspx.cs 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738
  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.reportmanage.operationdata
  8. {
  9. public partial class YearContrast : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. if (!this.IsPostBack)
  14. {
  15. for (int i = 2013; i < 2055; i++)
  16. {
  17. this.dptBgn.Items.Add(new ListItem(i.ToString()));
  18. this.dptEnd.Items.Add(new ListItem(i.ToString()));
  19. }
  20. this.dptBgn.SelectedValue = (System.DateTime.Now.Year-1).ToString();
  21. this.dptEnd.SelectedValue = System.DateTime.Now.Year.ToString();
  22. }
  23. }
  24. protected void exportExcel_Click(object sender, EventArgs e)
  25. {
  26. string fileName = "年呼叫数据对比" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
  27. Response.Clear();
  28. Response.Charset = "GB2312";
  29. Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
  30. Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName));
  31. Response.ContentType = "application/ms-excel";
  32. Response.Write(this.htHtmlReport.Value);
  33. Response.End();
  34. }
  35. }
  36. }