Imports System.Data Imports Extensiones Partial Class Acumuladores_RepPolizasVirtuales Inherits ClsPaginas Private Sub Acumuladores_RepPolizasVirtuales_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaCombos() End If End Sub Private Sub CargaCombos() CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto) txtFechaI.Text = DateTime.Now.FirstDayOfMonth.ToShortDateString() End Sub Public Sub CargaDatos() LnkExportarExcel.Visible = False Dim ObjAcum As New ClsAcumuladores Dim FI As Date = If(txtFechaI.Text.Length > 0, txtFechaI.Text.ToDate, MinFecha) Dim FF As Date = If(txtFechaF.Text.Length > 0, txtFechaF.Text.ToDate, MaxFecha) If ObjAcum.GetPolizaVirtualRep(FI, FF, DdlOpcion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.Toentero, UsuarioActual.CveUsuario) Then GvDatos.DataSource = ObjAcum.DtResultados If ObjAcum.DtResultados.Rows.Count > 0 Then LnkExportarExcel.Visible = True End If Else GvDatos.DataSource = Nothing End If ObjAcum.Dispose() GvDatos.DataBind() UpDatos.Update() UpAcciones.Update() End Sub Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub Protected Sub LnkExportarExcel_Click(sender As Object, e As EventArgs) GvDatos.ExportToExcel2($"RepPolizasVirtuales.xlsx") End Sub End Class