Se agregó formato para exportar a Excel y PDF
This commit is contained in:
@@ -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