protected void btnExport_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename = SQC.xls"); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); GrdSQCCompletedScheduleStatus.AllowPaging = false; GrdSQCCompletedScheduleStatus.RenderControl(htmlWrite); BindGrdSQCCompletedScheduleStatus(); Response.Write(stringWrite.ToString()); Response.End(); }
protected void btnExport_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename = SQC.xls"); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); if (Session["ScheduleTypeId"] != null && Convert.ToInt16(Session["ScheduleTypeId"].ToString()) != 3) { GrdCompletedScheduleStatus.AllowPaging = false; BindCompletedScheduleParameterGrid(Convert.ToInt16(Session["TestScheduleDetailId"].ToString())); GrdCompletedScheduleStatus.RenderControl(htmlWrite); } else { GrdSQCCompletedScheduleStatus.AllowPaging = false; BindSQCCompletedScheduleParameterGrid(Convert.ToInt16(Session["TestScheduleDetailId"].ToString())); GrdSQCCompletedScheduleStatus.RenderControl(htmlWrite); } Response.Write(stringWrite.ToString()); Response.End(); }