//btn_export_all_Click protected void btn_export_all_Click(object sender, EventArgs e) { PatientTable pt = new PatientTable(); DateTime beginDate, endDate; beginDate = DateTime.Now.AddMonths(-1); endDate = DateTime.Now.AddMonths(1); beginDate = Convert.ToDateTime(tbox_beginDate.Text); beginDate = beginDate.AddDays(-1); endDate = Convert.ToDateTime(tbox_endDate.Text); endDate = endDate.AddDays(1); string fileName = System.Configuration.ConfigurationManager.AppSettings["ExportPath"] + "所有数据" + DateTime.Now.ToString("yyyyMMdd") + ".xls"; string result = pt.ExportAll(fileName, beginDate, endDate); DownloadFile(result, Response, fileName, "所有数据.xls"); }