-- mejora en liga de reportes
This commit is contained in:
@@ -5,6 +5,7 @@ Imports ADSNetLibrary.SIGAPI.Models.OC.Response
|
||||
'Imports DocumentFormat.OpenXml
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.JScript
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class ContabilidadC_RegPrePolizaS
|
||||
@@ -2719,34 +2720,29 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
#Region "Paquete Egresos"
|
||||
Protected Sub LnkImprimirPDF_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(282).ToEntero = 1 Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(282) = "1" Then
|
||||
ImprimePrePolizasDetalleResumen("PDF")
|
||||
Else
|
||||
ImprimirPolizaPDF(IdPoliza)
|
||||
|
||||
ImprimirPolizaPDF()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ImprimirPolizaPDF(IdPoliza As Integer)
|
||||
Private Sub ImprimirPolizaPDF()
|
||||
|
||||
'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Bytes As Byte() = Nothing
|
||||
|
||||
Dim Ruta As String = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)
|
||||
Dim Archivo As New System.IO.FileInfo(Ruta)
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
Dim dtVC As DataTable
|
||||
Dim dr As DataRow
|
||||
dtVC = ObjConta.DtResultados.FiltraParametros("Contabilizable = 1", "Orden")
|
||||
dr = dtVC.Rows(0)
|
||||
Dim ruta As String = ""
|
||||
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString))
|
||||
params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
@@ -2757,9 +2753,6 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
Else
|
||||
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
params.Add(New ReportParameter("Numero", dr("FolioPoliza").ToString))
|
||||
params.Add(New ReportParameter("Moneda", ""))
|
||||
params.Add(New ReportParameter("CodigoPostal", ""))
|
||||
@@ -2770,26 +2763,20 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
If UsuarioActual.CveEmpresa.Contiene(140, 141) Then
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
End If
|
||||
|
||||
If Archivo.Exists Then
|
||||
|
||||
ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc"
|
||||
Ruta = UsuarioActual.Empresa.Ruta & "Formatos/Polizas.rdlc"
|
||||
|
||||
Else
|
||||
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
|
||||
ruta = "Empresas/Grales/Formatos/Polizas.rdlc"
|
||||
Ruta = "Empresas/Grales/Formatos/Polizas.rdlc"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
ImprimirbytesPDF(StreamPDF(ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True)
|
||||
ImprimirbytesPDF(StreamPDF(Ruta, dtVC, params, "ppoliza"), String.Format("{0}-{1}", TipoPoliza, dr("FolioPoliza").ToString), "PDF", True)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'Return String.Format("{0}\{1}\{2}.pdf", AppDomain.CurrentDomain.BaseDirectory, Tick, IdPoliza.ToString)
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
@@ -3230,97 +3217,43 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
|
||||
Private Sub ImprimePrePolizasDetalleResumen(Optional Tipo As String = "PDF")
|
||||
|
||||
Dim Archivo As System.IO.FileInfo
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Bytes As Byte() = Nothing
|
||||
Dim TipoPolizaString As String = If(DdlTipoPoliza.SelectedValue = "1", "I", If(DdlTipoPoliza.SelectedValue = "2", "E", "D")).ToString
|
||||
|
||||
Dim ImpresionPersonalizada As Integer = UsuarioActual.Empresa.Funcionalidad(282).ToEntero
|
||||
Dim ConceptoPoliza As String = TxtConcepto.Text
|
||||
|
||||
|
||||
Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/PolizasResumen.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Logo As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
|
||||
Dim RutaReporte As String = RutaFormatoReporte("PolizasResumen.rdlc")
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
'If ObjPoliza.GetPoliza(IdPoliza, -1, -1, -1, -1) AndAlso ObjPoliza.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If ObjConta.GetPrePolizasDetalleResumen(CvePrePoliza, UsuarioActual.CveEmpresa, ImpresionPersonalizada) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
Dim dtVC As DataTable
|
||||
Dim dr As DataRow
|
||||
|
||||
dtVC = ObjConta.DtResultados '.FiltraParametros("Contabilizable = 1", "Orden")
|
||||
dr = dtVC.Rows(0)
|
||||
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("TipoPoliza", DdlTipoPoliza.SelectedItem.Text))
|
||||
params.Add(New ReportParameter("Finicio", TxtFechaDocumento.Text))
|
||||
params.Add(New ReportParameter("FFin", TxtFechaDocumento.Text))
|
||||
|
||||
params.Add(New ReportParameter("Fecha", TxtFechaDocumento.Text))
|
||||
|
||||
params.Add(New ReportParameter("Numero", TxtFolio.Text))
|
||||
params.Add(New ReportParameter("Moneda", If(CveMoneda = 2, "Dolar", "Peso Mexicano")))
|
||||
params.Add(New ReportParameter("CodigoPostal", ""))
|
||||
|
||||
params.Add(New ReportParameter("UsuarioRegistro", TxtUsuarioElaboro.Text))
|
||||
params.Add(New ReportParameter("ConceptoPoliza", ConceptoPoliza))
|
||||
|
||||
params.Add(New ReportParameter("Folio", TxtFolio.Text))
|
||||
params.Add(New ReportParameter("pImg", RutaImagenLogo))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If Logo.Exists Then
|
||||
params.Add(New ReportParameter("pImg", $"file://{Logo.FullName}"))
|
||||
Else
|
||||
params.Add(New ReportParameter("pImg", ""))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Dim RutaReprote As String
|
||||
If Archivo.Exists Then
|
||||
RutaReprote = Archivo.FullName
|
||||
Else
|
||||
RutaReprote = $"{DirectorioEmpresas}Grales\Formatos\PolizasResumen.rdlc"
|
||||
End If
|
||||
|
||||
Dim TipoPolizaString = ""
|
||||
|
||||
Select Case DdlTipoPoliza.SelectedValue.ToEntero
|
||||
Case 1
|
||||
TipoPolizaString = "I"
|
||||
Exit Select
|
||||
Case 2
|
||||
TipoPolizaString = "E"
|
||||
Exit Select
|
||||
|
||||
Case Else
|
||||
TipoPolizaString = "D"
|
||||
Exit Select
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
ImprimirbytesPDF(StreamPDF(RutaReprote, dtVC, params, "PrePoliza", Formato:=Tipo), $"P{TipoPolizaString}{TxtFolio.Text}", Formato:=Tipo, Descarga:=True)
|
||||
ImprimirbytesPDF(StreamPDF(RutaReporte, dtVC, params, "PrePoliza", Formato:=Tipo), $"P{TipoPolizaString}{TxtFolio.Text}", Formato:=Tipo, Descarga:=True)
|
||||
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkImprimePDFResumen_Click(sender As Object, e As EventArgs)
|
||||
ImprimePrePolizasDetalleResumen("PDF")
|
||||
End Sub
|
||||
|
||||
'Protected Sub LnkImprimeExcelResumen_Click(sender As Object, e As EventArgs)
|
||||
' ImprimePrePolizasDetalleResumen("Excel")
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user