ImprimirPDF stimulsoft E172 y E174

This commit is contained in:
2022-10-13 00:38:36 -07:00
parent 3acacb18ec
commit ac9d5750c5

View File

@@ -7994,6 +7994,14 @@ Public Class ClsPaginas
Next
End If
'TEMPORAL, DEBE CAMBIARSE A FUNCIONALIDAD
If Vta.CveEmpresa.Contiene(172, 173) Then
Dim ArchivoStimulsfot As New System.IO.FileInfo(RutaFormato.Replace(".rdlc", ".mrt"))
If ArchivoStimulsfot.Exists Then
UsarStimulsoft = True
End If
End If
If Not UsarStimulsoft Then
Dim Archivo As New System.IO.FileInfo(RutaFormato)
If Archivo.Exists Then
@@ -8038,6 +8046,30 @@ Public Class ClsPaginas
Else
RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
'TEMPORAL, EMPRESAS EN LAS QUE SE UTILIZARA PRIMERO STIMULSOFT
If Vta.CveEmpresa.Contiene(172, 173) Then
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
If Guardar Then
If Not ArchivoPDF.Exists Then
Try
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
Catch ex As Exception
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
End Try
Else
Try
ArchivoPDF.Delete()
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
Catch ex As Exception
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
End Try
End If
End If
End If
End If
Catch ex As Exception
@@ -8089,7 +8121,7 @@ Public Class ClsPaginas
For Each rds As ReportDataSource In DataSource
Dim Nombre As String = rds.Name
If RutaReporte.Contains("Factura.mrt") Then
If RutaReporte.Contains("Factura.mrt") OrElse RutaReporte.Contains("Remision.mrt") OrElse RutaReporte.Contains("Cotizacion.mrt") OrElse RutaReporte.Contains("NotaDevolucion.mrt") Then
Select Case rds.Name
Case "DsOC"
Nombre = "DtDetalle"