From d341e38f500f28b879e73299d71806c7fb605fee Mon Sep 17 00:00:00 2001 From: MLopez Date: Thu, 16 Feb 2023 20:04:26 -0700 Subject: [PATCH] E140 Acumuladores Vigencia Exporta Excel -Tambien se corrige en nombre de archivo de RepVentasAutorizaciones --- Acumuladores/RepAcumuladoresVigencia.aspx | 6 +++ Acumuladores/RepAcumuladoresVigencia.aspx.cs | 49 ++++++++++++++++---- Ventas/RepVentasAutorizaciones.aspx.cs | 2 +- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Acumuladores/RepAcumuladoresVigencia.aspx b/Acumuladores/RepAcumuladoresVigencia.aspx index 01f7b200e..2ec474f82 100644 --- a/Acumuladores/RepAcumuladoresVigencia.aspx +++ b/Acumuladores/RepAcumuladoresVigencia.aspx @@ -10,6 +10,12 @@ +<%--
  • + Generar PDF +
  • --%> +
  • + Exportar Excel +
  • diff --git a/Acumuladores/RepAcumuladoresVigencia.aspx.cs b/Acumuladores/RepAcumuladoresVigencia.aspx.cs index c89cf910b..1d388aa4c 100644 --- a/Acumuladores/RepAcumuladoresVigencia.aspx.cs +++ b/Acumuladores/RepAcumuladoresVigencia.aspx.cs @@ -1,15 +1,46 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +using Extensiones; +using System; using System.Web.UI.WebControls; -using Extensiones; -using System.Data; -using Microsoft.Reporting.WebForms; -using System.Activities.Expressions; public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas { + #region PROPIEDADES + private bool Consultado + { + get { return Consultado = (bool)ViewState["Consultado"]; } + set { ViewState["Consultado"] = value; } + } + #endregion + + #region Exporta Excel PDF + protected void LnkExcel_Click(object sender, EventArgs e) + { + if (Consultado) + { + GvAcum.ExportToExcelG("RepAcumuladoresVigencia " + DateTime.Now.ToString("dd-MM-yyyy"), "Reporte de Vigencia de Acumuladores", UsuarioActual); + } + else + { + Alert("Por favor realice una consulta primero."); + } + } + /* + protected void LnkPdf_Click(object sender, EventArgs e) + { + if (Consultado) + { + GvAcum.GenerarReportePDF("Reporte de Autorizaciones de Ventas"); + } + else + { + Alert("Por favor realice una consulta primero."); + } + }*/ + public override void VerifyRenderingInServerForm(System.Web.UI.Control control) + { + } +#endregion + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -20,6 +51,7 @@ public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas private void InicializaValores() { + Consultado = false; CargaCombos(); txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-24).ToShortDateString(); txtFechaF.Text = DateTime.Now.LastDayOfMonth().AddMonths(-6).ToShortDateString(); @@ -37,6 +69,7 @@ public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas protected void BtnConsultar_Click(object sender, EventArgs e) { Consulta(); + Consultado = true; } private void Consulta() diff --git a/Ventas/RepVentasAutorizaciones.aspx.cs b/Ventas/RepVentasAutorizaciones.aspx.cs index 63655bfe1..18f5a7129 100644 --- a/Ventas/RepVentasAutorizaciones.aspx.cs +++ b/Ventas/RepVentasAutorizaciones.aspx.cs @@ -23,7 +23,7 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas { if (Consultado) { - GvDatos.ExportToExcelG("RepVentasAutorizaciones" + DateTime.Now, "Reporte de Autorizaciones de Ventas", UsuarioActual); + GvDatos.ExportToExcelG("RepVentasAutorizaciones" + DateTime.Now.ToString("dd-MM-yyyy"), "Reporte de Autorizaciones de Ventas", UsuarioActual); } else {