E140 Acumuladores Vigencia Exporta Excel

-Tambien se corrige en nombre de archivo de RepVentasAutorizaciones
This commit is contained in:
MLopez
2023-02-16 20:04:26 -07:00
parent 72e79c2948
commit d341e38f50
3 changed files with 48 additions and 9 deletions

View File

@@ -10,6 +10,12 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<%-- <li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i>Generar PDF</asp:LinkButton>
</li>--%>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>

View File

@@ -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()

View File

@@ -23,7 +23,7 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
get { return Consultado = (bool)ViewState["Consultado"]; }
set { ViewState["Consultado"] = value; }
}
#endregion
protected void LnkExcel_Click(object sender, EventArgs e)