protected void btnExportToExcel_Click(object sender, EventArgs e) { ClsExporttoExcel objExportToExcel = new ClsExporttoExcel(); DataSet ds = new DataSet(); binddata(true, out ds, txtFromDate.Text, txtToDate.Text); Response.AddHeader("Content-Disposition", "attachment;filename=ComplaintReport.xls"); GvDetails.AllowPaging = false; objExportToExcel.Convert(ds, Response, GvDetails); GvDetails.AllowPaging = true; }
protected void btnExportExcel_Click(object sender, EventArgs e) { DataSet ds = Session["DsDefect"] as DataSet; if (ds != null) { ClsExporttoExcel objExportToExcel = new ClsExporttoExcel(); GridView1.AllowPaging = false; Response.AddHeader("Content-Disposition", "attachment;filename=ComplaintReport.xls"); objExportToExcel.Convert(ds, Response, GridView1); GridView1.AllowPaging = true; Session["DsDefect"] = null; } }
protected void btnExportExcel_Click(object sender, EventArgs e) { DataSet dsExcel = new DataSet(); // Added By Ashok show added attribute header gvComm.Columns[25].Visible = true; gvComm.Columns[26].Visible = true; gvComm.Columns[27].Visible = true; // //changed by vikas panwar on 31 august 2011 //start here BindExcelDS("E"); //gvComm.Columns[25].Visible = false; //gvComm.Columns[26].Visible = false; //gvComm.Columns[27].Visible = false; //End Here dsExcel = (DataSet)ViewState["dsExcel"]; Response.AddHeader("Content-Disposition", "attachment;filename=DefectAnalysisReport.xls"); objExportToExcel.Convert(dsExcel, Response, gvExcel); }