Se agregó formato para exportar a Excel y PDF
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LbPDF" runat="server" OnClick="LbPDF_Click"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbExcel" runat="server" OnClick="LbExcel_Click"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Bancos
|
||||
@@ -15,7 +21,7 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="150px">
|
||||
|
||||
@@ -4,54 +4,67 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
Private Property DtBan As DataTable
|
||||
Get
|
||||
DtBan = DirectCast(ViewState("DtBan"), DataTable)
|
||||
End Get
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtBan") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
ObjBancos.Dispose()
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -80,6 +93,7 @@ Partial Class Bancos_CatBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -116,6 +130,7 @@ Partial Class Bancos_CatBancos
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -178,4 +193,28 @@ Partial Class Bancos_CatBancos
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
|
||||
Imprime("PDF")
|
||||
End Sub
|
||||
Protected Sub LbExcel_Click(sender As Object, e As EventArgs)
|
||||
Imprime("Excel")
|
||||
End Sub
|
||||
Private Sub Imprime(Formato As String)
|
||||
|
||||
If DtBan IsNot Nothing AndAlso DtBan.Rows.Count > 0 Then
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepBancos.rdlc", DtBan, params, "Reporte Bancos", Formato)
|
||||
Else
|
||||
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAdd" PostBackUrl="/Bancos/CuentasBancariasDetalle.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Agregar Cuenta Bancaria</asp:LinkButton>
|
||||
<%-- <img alt="Nuevo Número de Cuenta Bancaria" onclick="document.location.href='/Bancos/CuentasBancariasDetalle.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />--%>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAdd" PostBackUrl="/Bancos/CuentasBancariasDetalle.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Agregar Cuenta Bancaria</asp:LinkButton>
|
||||
<%-- <img alt="Nuevo Número de Cuenta Bancaria" onclick="document.location.href='/Bancos/CuentasBancariasDetalle.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />--%>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbPDF" runat="server" OnClick="LbPDF_Click"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbExcel" runat="server" OnClick="LbExcel_Click"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Número de Cuentas Bancarias / Cajas Chicas.
|
||||
@@ -23,10 +26,10 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCuenta" EmptyDataText="No se encontraron Números de Cuentas Registrados" ToolTip="Listado de Números de Cuentas" CssClass="table table-striped table-advance table-hover" Style=" text-align: center;" GridLines="None" Width="100%">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCuenta" EmptyDataText="No se encontraron Números de Cuentas Registrados" ToolTip="Listado de Números de Cuentas" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None" Width="100%">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="TipoCuenta" HeaderText="Tipo Cuenta" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Bancos/CuentasBancariasDetalle.aspx?CveCuenta={0}" DataNavigateUrlFields="CveCuenta" Target="_blank"/>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<asp:HyperLinkField DataTextField="TipoCuenta" HeaderText="Tipo Cuenta" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Bancos/CuentasBancariasDetalle.aspx?CveCuenta={0}" DataNavigateUrlFields="CveCuenta" Target="_blank" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Banco</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlBanco" runat="server" Text='<%# Eval("Banco", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -35,7 +38,7 @@
|
||||
<ItemTemplate> <asp:Literal ID="LtlNumCuenta" runat="server" Text='<%# Eval("NumCuenta", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>CLABE</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlCLABE" runat="server" Text='<%# Eval("CLABE", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -43,26 +46,30 @@
|
||||
<HeaderTemplate>Moneda</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Folio Inicial</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFInicial" runat="server" Text='<%# Eval("FInicial", "{0:d}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:Literal ID="LtlFInicial" runat="server" Text='<%# Eval("FInicial", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Usuario</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
|
||||
@@ -4,9 +4,21 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Bancos_CuentasBancarias
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtBan As DataTable
|
||||
Get
|
||||
DtBan = DirectCast(ViewState("DtBan"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtBan") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Configuración
|
||||
Private ReadOnly Property CveCuenta As Integer
|
||||
Get
|
||||
@@ -22,7 +34,7 @@ Partial Class Bancos_CuentasBancarias
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancosCuentas(-1) Then
|
||||
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
@@ -53,6 +65,7 @@ Partial Class Bancos_CuentasBancarias
|
||||
If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If ObjBancos.GetBancosCuentasUsuarios(-1) Then
|
||||
GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados
|
||||
End If
|
||||
@@ -126,4 +139,27 @@ Partial Class Bancos_CuentasBancarias
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
|
||||
Imprime("PDF")
|
||||
End Sub
|
||||
Protected Sub LbExcel_Click(sender As Object, e As EventArgs)
|
||||
Imprime("Excel")
|
||||
End Sub
|
||||
Private Sub Imprime(Formato As String)
|
||||
If DtBan IsNot Nothing AndAlso DtBan.Rows.Count > 0 Then
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/CuentasBancarias.rdlc", DtBan, params, "Reporte de Cuentas Bancarias", Formato)
|
||||
Else
|
||||
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user