CatAutorizacionLimites exporta Excel
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatAutorizacionLimites.aspx.vb" Inherits="Ventas_CatAutorizacionLimites" %>
|
<%@ Page Title="" Language="VB" EnableEventValidation="false" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatAutorizacionLimites.aspx.vb" Inherits="Ventas_CatAutorizacionLimites" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
@@ -22,9 +22,13 @@
|
|||||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar autorización</asp:LinkButton></li>
|
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar autorización</asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkExportarExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Exportar Excel</asp:LinkButton>
|
||||||
|
</li>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -336,4 +336,33 @@ Partial Class Ventas_CatAutorizacionLimites
|
|||||||
End Select
|
End Select
|
||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region " EXPORTA EXCEL "
|
||||||
|
Protected Sub LnkExportarExcel_Click(sender As Object, e As EventArgs) Handles LnkExportarExcel.Click
|
||||||
|
If GvDatos.Rows.Count <= 0 Then
|
||||||
|
Alert("No hay registros para exportar. Por favor modifique su consulta.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim StrFiltro As New StringBuilder
|
||||||
|
StrFiltro.AppendFormat("Filtro: ")
|
||||||
|
StrFiltro.AppendFormat("Estatus: {0}, ", DdlEstatus.SelectedItem)
|
||||||
|
StrFiltro.AppendFormat("Cliente: {0}, ", IIf(DdlClienteFiltro.SelectedText <> "", DdlClienteFiltro.SelectedText, "Todos"))
|
||||||
|
StrFiltro.AppendFormat("Vendedor: {0}, ", DdlVendedorFiltro.SelectedItem)
|
||||||
|
StrFiltro.AppendFormat("Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToString("dd/MM/yyyy"))
|
||||||
|
'If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(", Fecha Fin: {0}", txtFechaF.Text.ToDate.ToString("dd/MM/yyyy"))
|
||||||
|
Dim fechaFin As String = IIf(txtFechaF.Text <> "", txtFechaF.Text.ToDate.ToString("dd/MM/yyyy"), Now.ToString("dd/MM/yyyy"))
|
||||||
|
StrFiltro.AppendFormat(", Fecha Fin: {0}", fechaFin)
|
||||||
|
|
||||||
|
'Oculta columnas en export sin afectar GridView en página
|
||||||
|
Dim tcols = GvDatos.Columns.Count
|
||||||
|
GvDatos.HeaderRow.Cells(tcols - 2).Visible = False 'Autorizar/Rechazar
|
||||||
|
GvDatos.HeaderRow.Cells(tcols - 1).Visible = False 'Eliminar
|
||||||
|
|
||||||
|
GvDatos.ExportToExcelGembox("CatAutorizacionLimites " & txtFechaI.Text.ToDate.ToString("dd-MM-yyyy") + " a " & fechaFin.ToDate.ToString("dd-MM-yyyy"), UsuarioActual, "Catálogo de autorizaciones de límite de crédito", DatosFiltros:=StrFiltro.ToString())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user