private void CargarGrilla(bool exportarExcel)
        {
            DataTable datTabla = new ALCSA.Negocio.Abonos.Lista().ListarDesglose(
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdAbono),
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(hdfIdCobranza));

            gvDesglose.DataSource = datTabla;
            gvDesglose.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("Desglose_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(
                       datTabla,
                       "Desglose",
                       new string[] {
                "tipo_doc", "nro_doc", "monto", "Fvto", "dias", "intereses", "int_adic", "honorarios",
                "desc_honorarios", "desc_interes", "Otros_desc"
            },
                       new string[] {
                "Tipo Documento", "N° Documento", "Monto", "Fecha Vencimiento", "Días",
                "Intereses", "Interes Adicional", "Honorarios", "Desc. Honorarios", "Desc. Intereses",
                "Otros Descuentos"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
示例#2
0
        private List <ALCSA.Entidades.CallCenter.CampanaCobranza> LeerArchivo()
        {
            List <ALCSA.Entidades.CallCenter.CampanaCobranza> arrCobranzas = new List <ALCSA.Entidades.CallCenter.CampanaCobranza>();

            try
            {
                DataTable objTabla = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarExcelADataTable(fupArchivo.FileContent, fupArchivo.FileName.ToUpper().EndsWith(".XLSX"));
                if (objTabla != null && objTabla.Rows.Count > 0 && objTabla.Columns.Count > 1)
                {
                    foreach (DataRow objFila in objTabla.Rows)
                    {
                        string strRutDeudor = objFila[0] != null?ALCSA.FWK.IdentificacionTributaria.FormatearRut(objFila[0].ToString()).Replace(".", string.Empty) : string.Empty;

                        string strNumeroOperacion = objFila[1] != null ? objFila[1].ToString().Trim() : string.Empty;

                        if (!string.IsNullOrWhiteSpace(strRutDeudor) && !string.IsNullOrWhiteSpace(strNumeroOperacion))
                        {
                            arrCobranzas.Add(new ALCSA.Entidades.CallCenter.CampanaCobranza()
                            {
                                RutDeudor = strRutDeudor, NumeroOperacion = strNumeroOperacion
                            });
                        }
                    }
                }
            }
            catch
            {
                lblMensaje.Text = "No fué posible leer el archivo excel.";
            }
            return(arrCobranzas);
        }
示例#3
0
        private void CargarDetalle(bool exportarExcel)
        {
            IList <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoCliente> arrClientes = new ALCSA.Negocio.Gestion.Metricas.Cliente().Listar(ddlClientes.SelectedValue);

            gvDetalle.DataSource = arrClientes;
            gvDetalle.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("GestionClientes_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarListaDtoAExcel
                                                              <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoCliente>(
                       arrClientes,
                       "Gestión",
                       new string[] {
                "NombreCliente",
                "NumeroCobranzasVencidas",
                "NumeroCobranzasPorVencer",
                "NumeroCobranzasEnPlazo",
                "NumeroCobranzasTerminadas"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        private void CargaGrilla(int indice, bool exportarExcel)
        {
            string strRut = !string.IsNullOrEmpty(txtRutCli.Text) ? txtRutCli.Text : dllClientes.SelectedValue;

            strRut = strRut.Replace(".", string.Empty);

            DataTable datTabla = ConsultasEspecificas.DetalleResumenCliente(
                strRut,
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaInicio),
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaFin));

            this.Grilla.PageIndex  = indice;
            this.Grilla.DataSource = datTabla;
            this.Grilla.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("Rendiciones_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(
                       datTabla,
                       "Rendiciones",
                       new string[] {
                "nrooperacion", "rut_deudor", "nomdeudor", "nrocomprobante", "fechaabono", "montoabono", "concepto", "moneda"
            },
                       new string[] {
                "N° Operacion", "Rut Deudor", "Nombre Deudor", "N° Comprobante", "Fecha Abono", "Monto Abono", "Concepto", "Moneda"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
示例#5
0
        protected void btnExportarExcel_Click(object sender, EventArgs e)
        {
            string strRut           = ALCSA.FWK.Web.Control.ExtraerValor(ddlProcuradores);
            string strNombreArchivo = string.Format("Metas_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(
                       CargarDatosMesActual(),
                       strRut,
                       new string[] { "Etapa", "RutCliente", "RutDeudor", "Nombre", "EstadoCobranza", "Rol", "Tribunal", "Tramite", "FechaTramite" },
                       new string[] { "Etapa", "Rut Cliente", "Rut Deudor", "Nombre Deudor", "Estado Cobranza", "Rol", "Tribunal", "Tramite", "Fecha Tramite" }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        private void DescargarArchivoExcel()
        {
            int intIdCampana = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(lblNumeroCampana);

            if (intIdCampana < 1)
            {
                return;
            }

            DataTable objDatos = new ALCSA.Negocio.CallCenter.CampanaCobranza().ListarFormatoVicidial(intIdCampana);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(objDatos, "Vicidial"))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, string.Format("Vicidial_{0:ddMMyyyy_mmss_fff}.xls", DateTime.Now));
            }
        }
示例#7
0
        private void CargarDetalle(bool exportarExcel)
        {
            IList <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoProcurador> arrProcuradores = new ALCSA.Negocio.Gestion.Metricas.Procurador().Listar(ddlProcurador.SelectedValue);
            int intTotal = 0;

            foreach (ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoProcurador objDato in arrProcuradores)
            {
                intTotal += objDato.NumeroTotalCobranzas;
            }

            gvDetalle.DataSource = arrProcuradores;
            gvDetalle.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("GestionProcurador_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarListaDtoAExcel
                                                              <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoProcurador>(
                       arrProcuradores,
                       "Gestión",
                       new string[] {
                "NombreProcurador",
                "NumeroTotalCobranzas",
                "NumeroCobranzasVencidas",
                "NumeroCobranzasPorVencer",
                "NumeroCobranzasEnPlazo",
                "NumeroCobranzasTerminadas",
                "PorcentajeAsignado",
                "PorcentajeVencidas",
                "PorcentajePorVencer",
                "PorcentajeEnPlazo",
                "PorcentajeTerminado"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        private void CargarGrilla(int indice, bool exportarExcel)
        {
            IList <ALCSA.Entidades.Gestion.ControlRiesgo> arrDatos = new ALCSA.Negocio.Gestion.ControlRiesgo().Listar(
                (ddlTipo.SelectedValue == "E"),
                txtRutDeudor.Text.Replace(".", string.Empty),
                txtNumeroOperacion.Text.Trim(),
                ddlClientes.SelectedValue,
                ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ddlTribunales),
                ddlEstadosJuicios.SelectedValue,
                ddlProcuradores.SelectedValue,
                string.IsNullOrEmpty(txtDiasSinMovimiento.Text) ? -1 : ALCSA.FWK.Web.Control.ExtraerValorComoEntero(txtDiasSinMovimiento)
                );

            gvDatos.Columns[5].Visible = (ddlTipo.SelectedValue == "E");

            gvDatos.PageIndex  = indice;
            gvDatos.DataSource = arrDatos;
            gvDatos.DataBind();

            btnExportarExcel.Visible = (arrDatos.Count > 0);
            lblNumero.Text           = arrDatos.Count > 0 ? string.Format("N° Registros: {0:N0}", arrDatos.Count) : string.Empty;

            if (!exportarExcel)
            {
                return;
            }

            ALCSA.Negocio.Documentos.GeneradorExcel objExcel = new ALCSA.Negocio.Documentos.GeneradorExcel();
            string strNombreArchivo = string.Format("ControlRiesgo_{0}_{1:ddMMyyyy_hhmmss_fff}.xls", ddlTipo.SelectedValue == "E" ? "Exhortos" : "Juicios", DateTime.Now);

            string[] arrColumnas = ddlTipo.SelectedValue == "E"
                ? new string[] { "NumeroOperacion", "RutDeudor", "NombreDeudor", "NombreTribunal", "Rol", "RolExhorto", "NombreTramite", "FechaTramite", "NombreSubTramite", "FechaSubTramite", "NombreProcurador", "EstadoJuicio", "NombreCliente", "EstadoExhorto", "TramiteExhorto", "DiasSinMovimientos" }
                : new string[] { "NumeroOperacion", "RutDeudor", "NombreDeudor", "NombreTribunal", "Rol", "NombreTramite", "FechaTramite", "NombreSubTramite", "FechaSubTramite", "NombreProcurador", "EstadoJuicio", "NombreCliente", "EstadoExhorto", "TramiteExhorto", "DiasSinMovimientos" };

            using (System.IO.MemoryStream objArchivoMemoria = objExcel.ExportarListaDtoAExcel <ALCSA.Entidades.Gestion.ControlRiesgo>(arrDatos, ddlTipo.SelectedValue == "E" ? "Exhortos" : "Juicios", arrColumnas))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        private void CargarSeleccionadas(int indice, bool exportarExcel)
        {
            int intIdCampana = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(lblNumeroCampana);

            IList <ALCSA.Entidades.CallCenter.CampanaCobranza> arrCobranzas = new ALCSA.Negocio.CallCenter.CampanaCobranza().Listar(intIdCampana);

            gvCobranzasSeleccionadas.PageIndex  = indice;
            gvCobranzasSeleccionadas.DataSource = arrCobranzas;
            gvCobranzasSeleccionadas.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarListaDtoAExcel <ALCSA.Entidades.CallCenter.CampanaCobranza>(
                       arrCobranzas,
                       "Vicidial",
                       new string[] { "IdCampana", "RutDeudor", "NombreDeudor", "RutCliente", "NombreCliente", "NumeroOperacion", "NumeroComentarios", "DisposicionDeudor" }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, string.Format("Vicidial_{0:ddMMyyyy_mmss_fff}.xls", DateTime.Now));
            }
        }
示例#10
0
        private void CargarGrilla(int indice, bool exportarExcel)
        {
            ALCSA.FWK.BD.Servicio objServicio = new ALCSA.FWK.BD.Servicio();
            objServicio.Conexion = "CONN";
            objServicio.Comando  = "dbo.SPALC_GASTOS_DETALLE_LISTAR";

            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_NumeroOperacion", Valor = txtNumeroOperacion.Text.Trim(), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });
            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_Rol", Valor = txtRol.Text.Trim(), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });

            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_RutCliente", Valor = ddlCliente.SelectedValue, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });
            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_RutProcurador", Valor = ddlProcurador.SelectedValue, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });
            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_GrupoGasto", Valor = ddlGastos.SelectedValue, Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });
            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@INT_TipoGasto", Valor = ALCSA.FWK.Web.Control.ExtraerValorComoEntero(ddlTiposGastos), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });

            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_RutDeudor", Valor = txtRutDeudor.Text.Trim(), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });
            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@VC_NumeroSucursal", Valor = txtNumeroSucursal.Text.Trim(), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });

            objServicio.Parametros.Add(new ALCSA.FWK.BD.Parametro()
            {
                Nombre = "@DAT_FechaIngreso", Valor = ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaIngreso), Direccion = ALCSA.FWK.BD.Enumeradores.Direcciones.Entrada
            });

            DataTable objTable = objServicio.EjecutarDataTable();

            gvGastos.PageIndex  = indice;
            gvGastos.DataSource = objTable;
            gvGastos.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("Gastos_{0:ddMMyyyy_hhmmss_ffff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(
                       objTable,
                       "Tablero",
                       new string[] {
                "NumeroOperacion", "RutCliente", "NombreCliente", "RutDeudor", "NombreDeudor", "NumeroSucursal", "Rol", "NombreProcurador", "NumeroDocumento", "EstadoGasto", "FechaGasto",
                "TipoGasto", "MontoGasto"
            },
                       new string[] {
                "Numero Operacion", "Rut Cliente", "Nombre Cliente", "Rut Deudor", "Nombre Deudor", "N° Sucursal", "Rol", "Nombre Procurador", "Numero Documento", "Estado Gasto", "Fecha Gasto",
                "Tipo Gasto", "Monto Gasto"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
示例#11
0
        private void CargarGrilla(bool exportarExcel)
        {
            IList <ALCSA.Entidades.Parametros.Salidas.Metricas.Cumplimiento> arrCumplimientoEtapa = new ALCSA.Negocio.Gestion.Metricas.Avance().ListarCumplimientoPorEtapa(
                ALCSA.FWK.Web.Control.ExtraerValor(ddlClientes),
                ALCSA.FWK.Web.Control.ExtraerValor(ddlProcuradores),
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaDesde),
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaHasta));

            int intEnPlazo = 0, intPorVencer = 0, intVencidos = 0;

            foreach (ALCSA.Entidades.Parametros.Salidas.Metricas.Cumplimiento objDato in arrCumplimientoEtapa)
            {
                intEnPlazo   += objDato.CasosEnPlazo;
                intPorVencer += objDato.CasosPorVencer;
                intVencidos  += objDato.CasosVencido;
            }

            lblNumeroEnPlazo.Text   = intEnPlazo.ToString("N0");
            lblNumeroPorVencer.Text = intPorVencer.ToString("N0");
            lblNumeroVencidos.Text  = intVencidos.ToString("N0");

            gvDetalleEtapa.DataSource = arrCumplimientoEtapa;
            gvDetalleEtapa.DataBind();

            IList <ALCSA.Entidades.Parametros.Salidas.Metricas.Cumplimiento> arrCumplimientoTramite = new ALCSA.Negocio.Gestion.Metricas.Avance().ListarCumplimientoPorTramite(
                ALCSA.FWK.Web.Control.ExtraerValor(ddlClientes),
                ALCSA.FWK.Web.Control.ExtraerValor(ddlProcuradores),
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaDesde),
                ALCSA.FWK.Web.Control.ExtraerValorComoDateTime(txtFechaHasta));

            gvDetalleTramite.DataSource = arrCumplimientoTramite;
            gvDetalleTramite.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            string strNombreArchivo = string.Format("Cumplimiento_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarListaDtoAExcel
                                                              <ALCSA.Entidades.Parametros.Salidas.Metricas.Cumplimiento, ALCSA.Entidades.Parametros.Salidas.Metricas.Cumplimiento>(
                       arrCumplimientoEtapa,
                       arrCumplimientoTramite,
                       "Etapas",
                       "Tramites",
                       new string[] {
                "Etapa",
                "NumeroCasos",
                "CasosEnPlazo",
                "CasosPorVencer",
                "CasosVencido"
            },
                       new string[] {
                "Etapa",
                "Tramite",
                "NumeroCasos",
                "CasosEnPlazo",
                "CasosPorVencer",
                "CasosVencido"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.EnableViewState = false;

            string strParametro1  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par1");
            string strParametro2  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par2");
            string strParametro3  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par3");
            string strParametro4  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par4");
            string strParametro5  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par5");
            string strParametro6  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par6");
            string strParametro7  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par7");
            string strParametro8  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par8");
            string strParametro9  = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "par9");
            int    intParametro10 = ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "par10");
            int    intParametro11 = ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "par11");
            int    intParametro12 = ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "par12");

            DataTable datTabla = ALCLOCAL.ConsultasEspecificas.ConsultaTableroDOS(
                strParametro1,
                strParametro2,
                strParametro3,
                strParametro4,
                strParametro5,
                strParametro6,
                strParametro7,
                strParametro8,
                strParametro9,
                intParametro10,
                intParametro11.Equals(1),
                intParametro12
                );


            string strNombreArchivo = string.Format("Tablero_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarDataTableAExcel(
                       datTabla,
                       "Tablero",
                       new string[] {
                "cliente", "abogado", "NombreRemesa",
                "procurador", "nrooperacion", "procedimiento",
                "materia", "producto", "rut_deudor",
                "nomdeudor", "tipocobranza", "estadocobranza",
                "tribunal", "rol", "tramite",
                "ftramite", "proxgestion", "fechaproxgestion",
                "DiasSinGestion", "subtramite", "fechasubtramite",
                "EstadoJuicio", "IdCampanaCallCenter", "observacion"
            },
                       new string[] {
                "Acreedor", "Abogado", "Remesa",
                "Procurador", "N° Operación", "Procedimiento",
                "Materia", "Producto", "Rut Deudor",
                "Nombre Deudor", "Tipo Cobranza", "Estado Cobranza",
                "Tribunal", "Rol", "Tramite",
                "F. Tramite", "Prox. Gestión", "F. Prox. Gestión",
                "Días sin Gestión", "SubTrámite", "F. SubTrámite",
                "Estado Juicio", "ID Campaña Call Center", "Observación"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }
        private void CargarDetalle(int pagina, bool exportarExcel)
        {
            IList <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoClienteCobranza> arrCobranzas = new ALCSA.Negocio.Gestion.Metricas.Cliente().ListarCobranzas(hdfRutCliente.Value);

            if (arrCobranzas.Count > 0)
            {
                lblNombreCliente.Text = arrCobranzas[0].NombreCliente;
            }

            int    intIndice = 0;
            string strEtapa = ddlEtapas.SelectedValue, strTramite = ddlTramites.SelectedValue;

            while (intIndice < arrCobranzas.Count)
            {
                if (arrCobranzas[intIndice].EstadoAvance.ToLower() != hdfEstadoAvance.Value ||
                    (!string.IsNullOrEmpty(strEtapa) && strEtapa != arrCobranzas[intIndice].Etapa) ||
                    (!string.IsNullOrEmpty(strTramite) && strTramite != arrCobranzas[intIndice].Tramite))
                {
                    arrCobranzas.RemoveAt(intIndice);
                }
                else
                {
                    intIndice++;
                }
            }

            gvDetalle.PageIndex  = pagina;
            gvDetalle.DataSource = arrCobranzas;
            gvDetalle.DataBind();

            if (!exportarExcel)
            {
                return;
            }

            for (intIndice = 0; intIndice < arrCobranzas.Count; intIndice++)
            {
                arrCobranzas[intIndice].NumeroOperacion = string.Format("'{0}", arrCobranzas[intIndice].NumeroOperacion);
            }

            string strNombreArchivo = string.Format("GestionClientesCobrazas_{0:ddMMyyyy_hhmmss_fff}.xls", DateTime.Now);

            using (System.IO.MemoryStream objArchivoMemoria = new ALCSA.Negocio.Documentos.GeneradorExcel().ExportarListaDtoAExcel
                                                              <ALCSA.Entidades.Parametros.Salidas.Metricas.EstadoClienteCobranza>(
                       arrCobranzas,
                       "Gestión",
                       new string[] {
                "NumeroOperacion",
                "RutDeudor",
                "NombreDeudor",
                "NombreProcurador",
                "FechaIngreso",
                "PlazoDias",
                "DiasDesdeIngresoCobranza",
                "DiasRestantes",
                "DiasAtraso",
                "FechaLimite",
                "FechaTermino",
                "Rol",
                "Estado",
                "EstadoAvance",
                "Etapa",
                "Tramite",
                "SubTramite"
            }))
            {
                new ALCSA.FWK.Web.Sitio().DescargarArchivo(Response, objArchivoMemoria, strNombreArchivo);
            }
        }