protected void btnExportA_Click(object sender, EventArgs e) { bindData(true); if (gvResult.Rows.Count > 0) { Utils.ExportToExcel(HttpContext.Current, gvResult, "descriptor_query", ""); } }
protected void btnDownload_Click(object sender, EventArgs e) { DataTable dt = null; using (SecureData sd = new SecureData(false, UserManager.GetLoginToken(true))) { dt = sd.GetData("web_method_download", ":methodid=" + _methodid, 0, 0).Tables["web_method_download"]; dt = dt.Transform(new string[] { "crop", "method_name", "taxon", "acp", "acno", "acs" }, "coded_name", "coded_name", "observation_value"); gv1.DataSource = dt; gv1.DataBind(); Utils.ExportToExcel(HttpContext.Current, gv1, "method-trait", "Query Result"); } }
protected void btnDownload_Click(object sender, EventArgs e) { using (var sd = UserManager.GetSecureData(true)) { string id = hf.Value; var dt = sd.GetData("web_crop_marker_alldata", ":cropid=" + id, 0, 0).Tables["web_crop_marker_alldata"]; if (dt.Rows.Count > 0) { var dt2 = dt.Transform(new string[] { "crop", "method_name", "acp", "acNumber", "acs", "ivp", "ivNumber", "ivs", "ivType" }, "name", "name", "value"); gvAll.DataSource = dt2; gvAll.DataBind(); Utils.ExportToExcel(HttpContext.Current, gvAll, "marker-crop" + id, "Marker data for crop ID = " + id); } } }
protected void btnExportPheno_Click(object sender, EventArgs e) { /* * Response.Clear(); * Response.AddHeader("content-disposition", "attachment;filename=Phenotype.xls"); * Response.Charset = ""; * * // If you want the option to open the Excel file without saving then * // comment out the line below * // Response.Cache.SetCacheability(HttpCacheability.NoCache); * Response.ContentType = "application/ms-excel"; * System.IO.StringWriter stringWrite = new System.IO.StringWriter(); * System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); * gv.RenderControl(htmlWrite); * Response.Write(stringWrite.ToString()); * Response.End(); */ Utils.ExportToExcel(HttpContext.Current, gv, "phenotype", "phenotype data for " + lblPINumber.Text + ","); }
protected void btnDownload_Click(object sender, EventArgs e) { DataTable dt = null; if (traitID > 0) { using (SecureData sd = new SecureData(false, UserManager.GetLoginToken(true))) { using (DataManager dm = sd.BeginProcessing(true, true)) { string traitName = dm.ReadValue(@"select coded_name from crop_trait where crop_trait_id = :ctid", new DataParameters(":ctid", traitID, DbType.Int32)).ToString(); dt = sd.GetData("web_descriptor_detail_download", ":traitid=" + traitID + ";:methodid=0", 0, 0).Tables["web_descriptor_detail_download"]; gv1.DataSource = dt; gv1.DataBind(); Utils.ExportToExcel(HttpContext.Current, gv1, "grin", "Accession evaluated for " + traitName); } } } }
protected void btnExport_Click(object sender, EventArgs e) { Utils.ExportToExcel(HttpContext.Current, gv, "myfavorites", "My Favorites List:"); }
protected void btnDownload_Click(object sender, EventArgs e) { Utils.ExportToExcel(HttpContext.Current, gvAccession2, "grin", "Accession evaluated for " + traitName + " in study " + methodName); }
protected void btnExportGeno_Click(object sender, EventArgs e) { //exportToExcel(gvGeno, "genotype"); Utils.ExportToExcel(HttpContext.Current, gvGeno, "genotype", "genotype data for " + lblPINumber.Text + ","); }
protected void btnDownload_Click(object sender, EventArgs e) { Utils.ExportToExcel(HttpContext.Current, gvMarker, "marker" + lblMarker.Text, "Marker data for marker ID = " + lblMarker.Text); }
protected void btnDownload_Click(object sender, EventArgs e) { Utils.ExportToExcel(HttpContext.Current, gv1, "method-trait", "Query Result"); }