This commit is contained in:
rrene
2020-03-25 12:39:37 -07:00
4 changed files with 50 additions and 13 deletions

View File

@@ -1753,7 +1753,7 @@ Public Class ClsPaginas
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacenUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacenUsuarios = Dv.ToTable
GlobalDTAlmacenUsuarios = Dv.ToTable
Dv.Dispose()
@@ -5086,30 +5086,66 @@ Public Class ClsPaginas
lrds.Add(rds)
Return StreamPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
End Function
'Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte()
' 'limpio ReportViwer
' Dim sw As New System.Diagnostics.Stopwatch()
' sw.Start()
' If IsNothing(MR) Then MR = New ReportViewer
' Dim Bytes As Byte() = Nothing
' Try
' ' MasterReporteador.LocalReport.DataSources.Clear()
' For Each RDS As ReportDataSource In DataSource
' MR.LocalReport.DataSources.Add(RDS)
' Next
' MR.LocalReport.ReportPath = RutaReporte
' MR.ProcessingMode = ProcessingMode.Local
' MR.LocalReport.EnableExternalImages = True
' MR.LocalReport.SetParameters(Parametros)
' MR.LocalReport.Refresh()
' Dim Warnings As Warning() = Nothing
' Dim StreamIds As String() = Nothing
' Dim MimeType As String = Nothing
' Dim Encoding As String = Nothing
' Dim Extension As String = Nothing
' Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
' Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
' 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
' Catch ex As Exception
' GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
' 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
' 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
' End Try
' sw.Stop()
' If sw.Elapsed.TotalSeconds > 10 Then
' GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
' End If
' Return Bytes
'End Function
Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte()
'limpio ReportViwer
Dim sw As New System.Diagnostics.Stopwatch()
sw.Start()
If IsNothing(MR) Then MR = New ReportViewer
Dim Bytes As Byte() = Nothing
Try
' MasterReporteador.LocalReport.DataSources.Clear()
Dim fllreport As New ADSReportLib.FullTrustReportviewer()
fllreport.Initialize("DisplayName", RutaReporte, Parametros, New List(Of String()), True)
For Each RDS As ReportDataSource In DataSource
MR.LocalReport.DataSources.Add(RDS)
fllreport.AddDataSources(RDS)
Next
MR.LocalReport.ReportPath = RutaReporte
MR.ProcessingMode = ProcessingMode.Local
MR.LocalReport.EnableExternalImages = True
MR.LocalReport.SetParameters(Parametros)
MR.LocalReport.Refresh()
Dim Warnings As Warning() = Nothing
Dim StreamIds As String() = Nothing
Dim MimeType As String = Nothing
Dim Encoding As String = Nothing
Dim Extension As String = Nothing
Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
Bytes = fllreport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
@@ -5127,6 +5163,7 @@ Public Class ClsPaginas
Return Bytes
End Function
Public Function ImprimirPDFCrystal(RutaReporte As String, DataSource As DataTable, Parametros As List(Of CrystalParametro), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportDocument = Nothing) As Byte()
'limpio ReportViwer
Dim sw As New System.Diagnostics.Stopwatch()

BIN
Bin/ADSReportLib.dll Normal file

Binary file not shown.

BIN
Bin/ADSReportLib.pdb Normal file

Binary file not shown.

View File

@@ -6724,7 +6724,7 @@ Partial Class Ventas
End If
End If
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
If DivAlmacen.Visible AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
Alert("Tiene que seleccionar un almacén para la salida de almacén", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -11010,7 +11010,7 @@ Partial Class Ventas
Next
End If
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
If DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim Filtro As String = ""
Select Case factura.TipoDocto