using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace HySoft.BaseCallCenter.Web.reportmanage.operationdata { public partial class YearContrast : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { for (int i = 2013; i < 2055; i++) { this.dptBgn.Items.Add(new ListItem(i.ToString())); this.dptEnd.Items.Add(new ListItem(i.ToString())); } this.dptBgn.SelectedValue = (System.DateTime.Now.Year-1).ToString(); this.dptEnd.SelectedValue = System.DateTime.Now.Year.ToString(); } } protected void exportExcel_Click(object sender, EventArgs e) { string fileName = "年呼叫数据对比" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"; Response.Clear(); Response.Charset = "GB2312"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName)); Response.ContentType = "application/ms-excel"; Response.Write(this.htHtmlReport.Value); Response.End(); } } }