From 08cc81e6a20958c2644d55c3378afbbad9e8a009 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Mon, 15 May 2023 11:02:58 -0700 Subject: [PATCH] Correciones descargar reportes --- .../RepEntradasUsadosClientes.aspx.vb | 24 +++++++++++++------ App_Code/ClsPaginas.vb | 2 +- Compras/PopUpVerFactura.aspx.vb | 21 ++++++++++++---- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index b0ade4bb2..4f50f7d2c 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -91,8 +91,6 @@ Partial Class Acumuladores_RepEntradasUsadosClientes End Sub Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) - - Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2)) Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1) @@ -107,13 +105,18 @@ Partial Class Acumuladores_RepEntradasUsadosClientes Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsadosClientes} - ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "Entradas usados clientes", "PDF") + Dim FIRutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.Empresa.Ruta)) + Dim PathRutaReporte As String = "\Formatos\RepEntradasUsadosClientes.rdlc" + + If Not FIRutaReporte.Exists Then + PathRutaReporte = "\Empresas\Grales\Formatos\RepEntradasUsadosClientes.rdlc" 'No existe el General solo se hizo para la 140 + End If + + ImprimirPDF(PathRutaReporte, DatosEntradasUsadosClientes, params, "Entradas usados clientes", "PDF") End Sub Protected Sub BtnExcel_Click(sender As Object, e As EventArgs) - - Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2)) Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1) @@ -126,9 +129,16 @@ Partial Class Acumuladores_RepEntradasUsadosClientes params.Add(New ReportParameter("FechaInicial", TxtFechaI.Text)) params.Add(New ReportParameter("FechaFinal", TxtFechaF.Text)) - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsadosClientes} + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsadosClientes} + + Dim FIRutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.Empresa.Ruta)) + Dim PathRutaReporte As String = "\Formatos\RepEntradasUsadosClientes.rdlc" + + If Not FIRutaReporte.Exists Then + PathRutaReporte = "\Empresas\Grales\Formatos\RepEntradasUsadosClientes.rdlc" 'No existe el General solo se hizo para la 140 + End If - ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsadosClientes.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsadosClientes, params, "Entradas usados clientes", "Excel") + ImprimirPDF(PathRutaReporte, DatosEntradasUsadosClientes, params, "Entradas usados clientes", "Excel") End Sub diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7be3b6cb6..3966630af 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4647,7 +4647,7 @@ Public Class ClsPaginas bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") End If RutaReporte.Replace("/", "\") - If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) End If If EsProduccion Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 31f7c6a87..3003f31e8 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -5353,7 +5353,17 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Observaciones", Observaciones)) 'params.Add(New ReportParameter("Observaciones", "Observaciones con un tamaño mas grande para ver como se ve en el ticket chico.")) - ImprimirPDF(String.Format("Empresas/{0}/Formatos/UsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios") + + Dim FIRutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/UsadosEntradas.rdlc", UsuarioActual.Empresa.Ruta)) + Dim PathRutaReporte As String = "\Formatos\UsadosEntradas.rdlc" + + If Not FIRutaReporte.Exists Then + PathRutaReporte = "\Empresas\Grales\Formatos\UsadosEntradas.rdlc" 'No existe el General solo se hizo para la 140 + End If + + + ImprimirPDF(PathRutaReporte, DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios") + Case 7 Dim params As New List(Of ReportParameter) Dim CiudadSucursal As String = "" @@ -5469,7 +5479,8 @@ Partial Class PopUpVerFactura Dim CveFolio = "" CreaDT() - Dim RutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) + Dim FIRutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) + Dim PathRutaReporte As String = "\Formatos\OrdenServicio.rdlc" If ObjOS.GetOrdenesServicios(CveOS, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then If ObjOS.DtResultados.Rows.Count > 0 Then @@ -5528,9 +5539,9 @@ Partial Class PopUpVerFactura Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - If Not RutaReporte.Exists Then + If Not FIRutaReporte.Exists Then - RutaReporte = New System.IO.FileInfo(String.Format("{0}Empresas\Grales\Formatos\OrdenServicio.rdlc", ModExtensiones.DirectorioBaseEmpresas)) + PathRutaReporte = "\Empresas\Grales\Formatos\OrdenServicio.rdlc" params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) @@ -5555,7 +5566,7 @@ Partial Class PopUpVerFactura lrds.Add(rds2) ObjOS.Dispose() - ImprimirPDF(RutaReporte.FullName, lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) + ImprimirPDF(PathRutaReporte, lrds, params, NombreArchivo:=String.Format("OrdenServicio-{0}", CveFolio)) End Sub Private Sub CreaDT() TmpDTOS = New DataTable