From 6b45b10cebb2ef77815687bd3f978b781e30b81e Mon Sep 17 00:00:00 2001 From: HECTOR RODRIGUEZ Date: Thu, 10 Jun 2021 21:58:32 -0700 Subject: [PATCH] --- Ventas/RepVentas.aspx.vb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index f681e842e..9784b95ac 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -645,7 +645,9 @@ Partial Class Ventas_RepVentas Private Sub GenerarPDF(Optional Formato As String = "PDF") If DtVentas IsNot Nothing Then Dim StrFiltro As New StringBuilder - StrFiltro.AppendFormat(" Agrupado por: {0}", DdlGrupo.SelectedItem.Text) + StrFiltro.AppendFormat(" Agrupado por: {0}", DdlGrupo.SelectedItem.Text) + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepVentas.rdlc", UsuarioActual.Empresa.Ruta)) + Dim ruta As String = "" If DdlTipoComprobante.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Documento: {0}", DdlTipoComprobante.GetSelectedText) If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", txtFechaI.Text.ToDate.ToShortDateString) @@ -653,7 +655,7 @@ Partial Class Ventas_RepVentas If DdlProyecto.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Proyecto: {0}", DdlProyecto.SelectedItem.Text) If DdlSubProyecto.GetSelectedText <> "" Then StrFiltro.AppendFormat(" SubProyecto: {0}", DdlSubProyecto.GetSelectedText) - If DdlClientes.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Cliente: {0}", DdlClientes.SelectedText) + If DdlClientes.SelectedValue <> "" Then StrFiltro.AppendFormat(" Cliente: {0}", DdlClientes.SelectedText) If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Vendedor: {0}", DdlVendedor.GetSelectedText) If DdlEstatus.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Estatus: {0}", DdlEstatus.GetSelectedText) If DdlSubProyectoEjecucion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Proyecto Ejecución: {0}", DdlSubProyectoEjecucion.SelectedItem.Text) @@ -682,8 +684,15 @@ Partial Class Ventas_RepVentas params.Add(New ReportParameter("LogoPath", logouri)) Else params.Add(New ReportParameter("LogoPath", "")) + End If + + If Archivo.Exists Then + ruta = UsuarioActual.Empresa.Ruta & "Formatos/RepVentas.rdlc" + Else + ruta = "Empresas/Grales/Formatos/RepVentas.rdlc" End If - ImprimirPDF("Empresas/Grales/Formatos/RepVentas.rdlc", dt, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato) + + ImprimirPDF(ruta, dt, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato) Else Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) End If