3 Contratos VYA impresion de PDF solo sale un regitro y XLS marca error, 2 En Inicio Vtas sin enviar correo, poner un envíar masivo check all y boton en viar
This commit is contained in:
@@ -18,11 +18,24 @@ Partial Class ListadoContratos
|
||||
ViewState("DtAvanceDocumento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
#Region "Carga Página"
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
If Not IsPostBack Then
|
||||
DtDatos = New DataTable
|
||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
||||
txtFechaF.Text = DateTime.Now.AddDays(1).ToShortDateString
|
||||
InicializaCombos()
|
||||
@@ -63,6 +76,7 @@ Partial Class ListadoContratos
|
||||
If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, CveSubProyecto:=DdlCentroCostos.SelectedValue.ToEntero, CveTipoAF:=DdlTipoUnidad.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero,
|
||||
FechaInicioIngreso:=txtFechaI.Text.ToDate, FechaFinIngreso:=txtFechaF.Text.ToDate) Then
|
||||
GvContratos.DataSource = ObjContratos.DtResultados
|
||||
DtDatos = ObjContratos.DtResultados.Copy
|
||||
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
@@ -265,15 +279,19 @@ Partial Class ListadoContratos
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||
'GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||
ImprimeReporte("Excel")
|
||||
End Sub
|
||||
Protected Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, TipoContrato:=2) Then
|
||||
ImprimeReporte("PDF")
|
||||
End Sub
|
||||
Private Sub ImprimeReporte(Formato As String)
|
||||
'Dim ObjContratos As New ClsContratos
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
Dim Imagen As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
|
||||
Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim Cliente As String = If(DdlClientes.SelectedValue = "-1", "", $" <b>Cliente:</b> {DdlClientes.SelectedText}")
|
||||
Dim dt As DataTable = ObjContratos.DtResultados
|
||||
|
||||
Dim params As New List(Of ReportParameter) From {
|
||||
New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa),
|
||||
New ReportParameter("FechaInicio", "-1"),
|
||||
@@ -283,11 +301,11 @@ Partial Class ListadoContratos
|
||||
New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString),
|
||||
New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))
|
||||
}
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratos.rdlc", dt, params, NombreArchivo:="Reporte Contratos")
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepContratos.rdlc", DtDatos, params, NombreArchivo:="Reporte Contratos", Formato:=Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub Consultar(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
|
||||
Reference in New Issue
Block a user