protected void excel_error_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=FECHAS_VP_INTRAN" + DateTime.Now.ToShortDateString() + ".xls"); Response.Charset = ""; // If you want the option to open the Excel file without saving than // comment out the line below Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); G_errores.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); Response.End(); }
protected void BTN_error_Click(object sender, EventArgs e) { string productos = agregra_comillas(l_vendedores.Text); string bodega2 = agregra_comillas(lb_bodegas2.Text); string where_bodega = ""; if (productos != "") { where += " and invtid in (" + productos + ")"; } if (bodega2 != "") { where += " and siteid in (" + bodega2 + ")"; where_bodega += " and siteid in (" + bodega2 + ")"; } DataTable td2 = ReporteRNegocio.fechas_incorrectas(CB_TIPO_DOC_GRILLA.SelectedValue, TX_AÑO.Text, where); G_errores.DataSource = td2; G_errores.DataBind(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "tee1ees", "<script> CLICK_MODAL_ERRORES(); </script>", false); }