Correciones descargar reportes

This commit is contained in:
Oscar Irigoyen
2023-05-15 11:02:58 -07:00
parent 28e1693dc4
commit 08cc81e6a2
3 changed files with 34 additions and 13 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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