protected void btnProcesar_Click(object sender, EventArgs e) { //BLReportes rep = new BLReportes(); int SelCue; btnProcesar.Enabled = false; SelCue = chkCuentas.Items.Cast <ListItem>().Count(li => li.Selected); if (chkSociedades.Items[0].Selected == false && (chkCuentas.SelectedIndex == 0 || SelCue >= chkCuentas.Items.Count - 1)) { uscMsgBox1.AddMessage("La selección actual corresponde a los reportes encontrados en la sección 'Reporte con filtro por sociedad'.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } else { //grdDatosF.DataSource = rep.Cuentas(ArmadoCadena(chkSociedades), // ArmadoCadena(chkCuentas), // Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); //grdDatosF.DataBind(); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.Cuentas((int)DatosGenerales.TiposDocumentos.Reporte_CuentasContables, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSCtaCont_", "xlsx"), 250000, ArmadoCadena(chkSociedades), ArmadoCadena(chkCuentas)); Response.Redirect("DocumentosUsuario.aspx"); } //btnProcesar.Enabled = true; //LimpiarControles(false); }
protected void btnProcesar_Click(object sender, EventArgs e) { string Validaciones = Valida(); //BLReportes reporte = new BLReportes(); if (Validaciones == "") { //grdDatos.DataSource = reporte.ReporteGeneralAplicaciones(ArmadoCadena(chklEstados), // ArmadoCadena(chklTipos), // ddlTFS.SelectedItem.Text, // ddlEsProductiva.SelectedItem.Text).Tables[0]; //grdDatos.DataBind(); //if (grdDatos.Rows.Count > 0) // ExportarGridAExcel(grdDatos); //else // uscMsgBox1.AddMessage("No se encontraron registros para exportar", YaBu.MessageBox.uscMsgBox.enmMessageType.Info); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.GeneralAplicaciones((int)DatosGenerales.TiposDocumentos.Reporte_GeneralDeAplicaciones, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSGenApp_", "xlsx"), 250000, ArmadoCadena(chklEstados), ArmadoCadena(chklTipos), ddlTFS.SelectedItem.Text, ddlEsProductiva.SelectedItem.Text); Response.Redirect("DocumentosUsuario.aspx"); } else { uscMsgBox1.AddMessage(Validaciones, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
protected void btnProcesar_Click(object sender, EventArgs e) { //BLReportes rep = new BLReportes(); //btnProcesar.Enabled = false; if (chkServidores.Items[0].Selected == false) { //grdDatos.DataSource = rep.ReporteRelSrvApp(ArmadoCadena(chkServidores), // Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); //grdDatos.DataBind(); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.RelSrvApp((int)DatosGenerales.TiposDocumentos.Reporte_AplicacionesEnServidor, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSSrvApp_", "xlsx"), 250000, ArmadoCadena(chkServidores)); Response.Redirect("DocumentosUsuario.aspx"); } else { //grdDatos.DataSource = rep.ReporteRelSrvApp("", // Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); //grdDatos.DataBind(); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.RelSrvApp((int)DatosGenerales.TiposDocumentos.Reporte_AplicacionesEnServidor, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSSrvApp_", "xlsx"), 250000, ""); Response.Redirect("DocumentosUsuario.aspx"); } //btnProcesar.Enabled = true; //chkServidores.ClearSelection(); //chkServidores.Items[0].Selected = true; }
protected void btnEjecutar_Click(object sender, EventArgs e) { string Errores = ""; Errores = Validar(); if (Errores != "") { mp1.Show(); lblMsj.Text = "Errores encontrados: " + "<br/><br/>" + Errores; } else { int RD_Id = 0; int.TryParse(ddlReportes.SelectedValue, out RD_Id); if (RD_Id > 0) { WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.EjecutarRD((int)DatosGenerales.TiposDocumentos.Reportes_Dinamicos, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSDin_", "xlsx"), 250000, ArmadoParametros(), RD_Id); Response.Redirect("DocumentosUsuario.aspx"); } else { mp1.Show(); lblMsj.Text = "Errores encontrados: " + "<br/><br/>No se obtuvo el Id del reporte."; } } }
private void ProcesarArchivo(byte[] Datos, string MsjError, int Numero_Prestamo, int Anno) { try { lblMsj.Text = ""; if (MsjError == "") { string Archivo = Server.MapPath("../Reportes/" + DatosGenerales.RutaLocalReportesDinamicos) + "/" + DatosGenerales.GeneraNombreArchivoRnd("Constancia_", "pdf"); System.IO.BinaryWriter binWriter = new System.IO.BinaryWriter(System.IO.File.Open(Archivo, System.IO.FileMode.CreateNew, System.IO.FileAccess.ReadWrite)); binWriter.Write(Datos); binWriter.Close(); ltlDescarga.Text = "<a href='" + DatosGenerales.RutaReportesDinamicos + System.IO.Path.GetFileName(Archivo) + "' class='HyperLink'>Descargar archivo</a>"; WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.RegistrarArchivoTempGeneral((int)DatosGenerales.TiposDocumentos.Constancias, Session["UserNameLogin"].ToString(), System.IO.Path.GetFileName(Archivo), true); Response.Redirect("../Reportes/DocumentosUsuario.aspx"); } else { lblMsj.Text = MsjError; } } catch (Exception ex) { lblMsj.Text = "Error: " + ex.Message; } }
protected void btnProcesar_Click(object sender, EventArgs e) { lblMsj.Text = ""; pnlMsj.Visible = false; if (!chkRevisarTodos.Checked && string.IsNullOrWhiteSpace(txtEquipo.Text)) { lblMsj.Text = "Debe especificar un nombre de equipo."; pnlMsj.Visible = true; txtEquipo.Focus(); return; } string Pass = ""; De_CryptDLL.De_Crypt cripto = new De_CryptDLL.De_Crypt(); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); Pass = cripto.Encriptar(txtPass.Text, DatosGenerales.StandardKey, true); exportar.MonitoreoSW((int)DatosGenerales.TiposDocumentos.Reporte_MonitoreoSW, Session["UserNameLogin"].ToString(), Server.MapPath("../Reportes/" + DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSMonSW_", "xlsx"), 250000, txtUsuario.Text, Pass, txtDominio.Text, chkRevisarTodos.Checked, txtEquipo.Text); Response.Redirect("../Reportes/DocumentosUsuario.aspx"); }
protected void GenerarReporte(DateTime FechaIni, DateTime FechaFin, int NumeroMovimiento, string Cuenta, string DescripcionCuenta, string DescripcionEncabezado, int Moneda, bool BusquedaEstricta) { WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.ReportePolizas((int)DatosGenerales.TiposDocumentos.Reporte_Polizas_Abanks, Session["UserNameLogin"].ToString(), FechaIni, FechaFin, NumeroMovimiento, Cuenta, DescripcionCuenta, DescripcionEncabezado, Moneda, BusquedaEstricta, Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSPolAb_", "xlsx"), 250000); Response.Redirect("DocumentosUsuario.aspx"); }
protected void btnProcesar_Click(object sender, EventArgs e) { //BLReportes rep = new BLReportes(); int TotSel = 0; int SelAnio, SelEmp, SelCon; //btnProcesar.Enabled = false; SelAnio = chkAnios.Items.Cast <ListItem>().Count(li => li.Selected); SelEmp = chkEmpleados.Items.Cast <ListItem>().Count(li => li.Selected); SelCon = chkConceptos.Items.Cast <ListItem>().Count(li => li.Selected); if (chkAnios.SelectedIndex == 0 || SelAnio >= chkAnios.Items.Count - 1) { TotSel++; } if (chkEmpleados.SelectedIndex == 0 || SelEmp >= chkEmpleados.Items.Count - 1) { TotSel++; } if (chkConceptos.SelectedIndex == 0 || SelCon >= chkConceptos.Items.Count - 1) { TotSel++; } int ItmsSel = SelAnio + SelEmp + SelCon; int Itms = chkAnios.Items.Count + chkEmpleados.Items.Count + chkConceptos.Items.Count; if (TotSel == 3 || ItmsSel > (Itms * .25)) { uscMsgBox1.AddMessage("Demasiados elementos seleccionados. No se generará el reporte.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); btnProcesar.Enabled = true; LimpiarControles(false); } else { if (chkAnios.Items[0].Selected == false && (chkEmpleados.SelectedIndex == 0 || SelEmp >= chkEmpleados.Items.Count - 1) && (chkConceptos.SelectedIndex == 0 || SelCon >= chkConceptos.Items.Count - 1)) { uscMsgBox1.AddMessage("La selección actual corresponde a los reportes encontrados en la sección 'Reporte con filtro por año'.", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); btnProcesar.Enabled = true; LimpiarControles(false); } else { WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.Acumulados_SAP((int)DatosGenerales.TiposDocumentos.Reporte_Acumulados_SAP, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSAcum_", "xlsx"), 250000, ArmadoCadena(chkAnios), ArmadoCadena(chkEmpleados), ArmadoCadena(chkConceptos)); Response.Redirect("DocumentosUsuario.aspx"); //grdDatosF.DataSource = rep.Acumulados(ArmadoCadena(chkAnios), // ArmadoCadena(chkEmpleados), // ArmadoCadena(chkConceptos), // Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); //grdDatosF.DataBind(); } } }
protected void btnArchivo_Click(object sender, EventArgs e) { //Response.Redirect(hddArchivo.Value); //Response.Write("<script type='text/javascript'>window.open('" + hddArchivo.Value + "','_blank');</script>"); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.RegistrarArchivoTempGeneral((int)DatosGenerales.TiposDocumentos.Cartero_Cartas, Session["UserNameLogin"].ToString(), hddArchivoSencillo.Value, true); Response.Redirect("../Reportes/DocumentosUsuario.aspx"); }
protected void btnProcesar_Click(object sender, EventArgs e) { //BLReportes rep = new BLReportes(); //btnProcesar.Enabled = false; //string Archivo = ""; if (chkServidores.Items[0].Selected == false) { //Archivo = rep.ReporteDiscosSrv(ArmadoCadena(chkServidores), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.DiscosSrv((int)DatosGenerales.TiposDocumentos.Reporte_DiscosEnServidor, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSDiscosSrv_", "xlsx"), 250000, ArmadoCadena(chkServidores)); Response.Redirect("DocumentosUsuario.aspx"); } else { //Archivo = rep.ReporteDiscosSrv("", Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.DiscosSrv((int)DatosGenerales.TiposDocumentos.Reporte_DiscosEnServidor, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSDiscosSrv_", "xlsx"), 250000, ""); Response.Redirect("DocumentosUsuario.aspx"); } //if (Archivo.Length > 4 && Archivo.Substring(0, 5) != "Error") //{ // Archivo = DatosGenerales.RutaReportesDinamicos + Archivo; //} //else //{ // lblMsj.Text = Archivo; //} //if (Archivo != "") // Response.Redirect(Archivo); //else // DatosGenerales.EnviaMensaje("No se encontraron resultados para su búsqueda.", "Exportar a Excel", DatosGenerales.TiposMensaje.Informacion); //btnProcesar.Enabled = true; //chkServidores.ClearSelection(); //chkServidores.Items[0].Selected = true; }
protected void btnProcesar_Click(object sender, EventArgs e) { //BLReportes rep = new BLReportes(); //grdDatosF.DataSource = rep.DatosPersonales(ArmadoCadena(chkEmpleados), // Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos)); //grdDatosF.DataBind(); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.DatosPersonales((int)DatosGenerales.TiposDocumentos.Reporte_DatosPersonales, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSDatPer_", "xlsx"), 250000, ArmadoCadena(chkEmpleados)); Response.Redirect("DocumentosUsuario.aspx"); //btnProcesar.Enabled = true; //LimpiarControles(false); }
protected void btnProcesar_Click(object sender, EventArgs e) { string Validaciones = Valida(); //BLReportes reporte = new BLReportes(); if (Validaciones == "") { //grdDatos.DataSource = reporte.ReporteInventarioEquipo(ArmadoCadena(chklTipoEquipo), // ArmadoCadena(chklMarca), // ArmadoCadena(chklUbicacion), // ArmadoCadena(chklUsuarios), // txtResponsivas.Text, // txtModelos.Text, // txtNoSerie.Text, // txtFechaIni.Text, // txtFechaFin.Text, // ArmadoCadena(chkEstados)); //grdDatos.DataBind(); //if (grdDatos.Rows.Count > 0) // ExportarGridAExcel(grdDatos); //else // uscMsgBox1.AddMessage("No se encontraron registros para exportar", YaBu.MessageBox.uscMsgBox.enmMessageType.Info); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.InventarioEquipos((int)DatosGenerales.TiposDocumentos.Reporte_InventarioEquipos, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSInvEq_", "xlsx"), 250000, ArmadoCadena(chklTipoEquipo), ArmadoCadena(chklMarca), ArmadoCadena(chklUbicacion), ArmadoCadena(chklUsuarios), txtResponsivas.Text, txtModelos.Text, txtNoSerie.Text, txtFechaIni.Text, txtFechaFin.Text, ArmadoCadena(chkEstados)); Response.Redirect("DocumentosUsuario.aspx"); } else { uscMsgBox1.AddMessage(Validaciones, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
protected void btnProcesar_Click(object sender, EventArgs e) { string Validaciones = Valida(); //BLReportes reporte = new BLReportes(); if (Validaciones == "") { //grdDatos.DataSource = reporte.ReporteInventarioSW(ArmadoCadena(chklEmpresas), // ArmadoCadena(chklGrupos, 1), // txtDescripcionSW.Text, // txtVersiones.Text, // txtNoParte.Text, // txtLlaves.Text, // ArmadoCadena(chklUbicacion), // txtObservaciones.Text, // ddlExistencia.SelectedItem.Text, // false).Tables[0]; //grdDatos.DataBind(); //if (grdDatos.Rows.Count > 0) // ExportarGridAExcel(grdDatos); //else // uscMsgBox1.AddMessage("No se encontraron registros para exportar", YaBu.MessageBox.uscMsgBox.enmMessageType.Info); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.InventarioSW((int)DatosGenerales.TiposDocumentos.Reporte_InventarioSW, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSSrvApp_", "xlsx"), 250000, ArmadoCadena(chklEmpresas), ArmadoCadena(chklGrupos, 1), txtDescripcionSW.Text, txtVersiones.Text, txtNoParte.Text, txtLlaves.Text, ArmadoCadena(chklUbicacion), txtObservaciones.Text, ddlExistencia.SelectedItem.Text); Response.Redirect("DocumentosUsuario.aspx"); } else { uscMsgBox1.AddMessage(Validaciones, YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); } }
protected void btnProcesar_Click(object sender, EventArgs e) { //BLServidores objSrv = new BLServidores(); int TR_Id = 0; int Obj_Id = 0; lblMsj.Text = ""; txtCinta.Text = txtCinta.Text.Trim(); int.TryParse(ddlFiltro.SelectedValue, out TR_Id); int.TryParse(ddlObj.SelectedValue, out Obj_Id); WS_Excel.ExportarSoapClient exportar = new WS_Excel.ExportarSoapClient(); exportar.CintasRespaldo((int)DatosGenerales.TiposDocumentos.Reporte_CintasRespaldo, Session["UserNameLogin"].ToString(), Server.MapPath(DatosGenerales.RutaLocalReportesDinamicos), DatosGenerales.GeneraNombreArchivoRnd("RptWSCintas_", "xlsx"), 250000, TR_Id, Obj_Id, txtCinta.Text); Response.Redirect("DocumentosUsuario.aspx"); //string Archivo = objSrv.ReporteCintas(TR_Id, Obj_Id, txtCinta.Text, Server.MapPath("../Reportes/" + DatosGenerales.RutaLocalReportesDinamicos)); //if (Archivo.Length > 4 && Archivo.Substring(0, 5) != "Error") //{ // Archivo = DatosGenerales.RutaReportesDinamicos + Archivo; //} //else //{ // lblMsj.Text = Archivo; //} //if (Archivo != "") // Response.Redirect(Archivo); //else // DatosGenerales.EnviaMensaje("No se encontraron resultados para su búsqueda.", "Exportar a Excel", DatosGenerales.TiposMensaje.Informacion); }