private void buscar() { string strGrupo = ddl_Grupos.Items[ddl_Grupos.SelectedIndex].Value; string strEstatus = ddl_Estaus.Items[ddl_Estaus.SelectedIndex].Value; String strCentral = ddl_Central.Items[ddl_Central.SelectedIndex].Value; String strGestor = cboGestorMedicion.Items[cboGestorMedicion.SelectedIndex].Value; if (strGestor == "-- TODOS --") { strGestor = "0"; } System.Data.DataTable dtGR = new System.Data.DataTable(); clsGeneralReport oclsGeneralReport = new clsGeneralReport(); dtGR = oclsGeneralReport.GetGeneralReport("1" , "" , toggleConvenios.Checked ? "0" : "1" , toggleComunicacion.Checked ? "0" : "1" , toggleMedicion.Checked ? "0" : "1" , strGrupo == "" ? "0" : strGrupo , strCentral == "" ? "0" : strCentral , strEstatus == "" ? "0" : strEstatus , strGestor == "" ? "0" : strGestor); if (dtGR != null && (dtGR.Rows.Count > 0)) { Session["dtGR"] = dtGR; strHTMLElectric = oclsGeneralReport.CreateTableHTML(dtGR); DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTMLElectric.ToString() }); } }
protected void Page_Load(object sender, EventArgs e) { System.Data.DataTable dtGR = new System.Data.DataTable(); clsGeneralReport oclsGeneralReport = new clsGeneralReport(); if (!IsPostBack) { dtGR = oclsGeneralReport.GetGeneralReport("1", "", "1", "1", "0", "0", "0", "0", "0"); if (dtGR != null && (dtGR.Rows.Count > 0)) { Session["dtGR"] = dtGR; strHTMLElectric = oclsGeneralReport.CreateTableHTML(dtGR); DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTMLElectric.ToString() }); } } }
protected void btnSave_Click(object sender, EventArgs e) { LogErrorMedicion clsError = new LogErrorMedicion(); clsError.logMessage = "btnSave_Click entra"; clsError.logModule = "btnSave_Click"; clsError.LogWrite(); string strGrupo = ddl_Grupos.Items[ddl_Grupos.SelectedIndex].Value; string strEstatus = ddl_Estaus.Items[ddl_Estaus.SelectedIndex].Value; String strCentral = ddl_Central.Items[ddl_Central.SelectedIndex].Value; String strGestor = cboGestorMedicion.Items[cboGestorMedicion.SelectedIndex].Value; System.Data.DataTable dtGR = new System.Data.DataTable(); clsGeneralReport oclsGeneralReport = new clsGeneralReport(); dtGR = oclsGeneralReport.GetGeneralReport("1" , "" , toggleConvenios.Checked ? "0" : "1" , toggleComunicacion.Checked ? "0" : "1" , toggleMedicion.Checked ? "0" : "1" , strGrupo == "" ? "0" : strGrupo , strCentral == "" ? "0" : strCentral , strEstatus == "" ? "0" : strEstatus , strGestor == "" ? "0" : strGestor ); DataSet dsGR = new DataSet(); try { //dtGR = (System.Data.DataTable)Session["dtGR"]; if (dtGR.Rows.Count > 0) { //ExporttoExcel(dtGR); dsGR.Tables.Add(dtGR); clsError.logMessage = "if (dtGR.Rows.Count > 0) "; clsError.logModule = "btnSave_Click"; clsError.LogWrite(); ExporttoExcelClosedXML(dsGR); //ExporttoExcelXML(dsGR); // ExportDataSetToExcel(dsGR); //UploadDataTableToExcel(dtGR); } } catch (Exception ex) { clsError.logMessage = ex.ToString(); clsError.logModule = "btnSave_Click"; clsError.LogWrite(); } finally { // Response.Redirect("resumengeneral.aspx"); } }