imprimir reporte de dispositivos
This commit is contained in:
1000
Empresas/Grales/Formatos/EquiposGPS.rdlc
Normal file
1000
Empresas/Grales/Formatos/EquiposGPS.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -291,6 +291,17 @@
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpReporteGpsExcel" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkReporteExcel" Visible="False" OnClick="GenerarReporteExcel" data-toggle="tooltip" data-placement="left" runat="server" Text="<i class='fa fa-file-excel-o'></i> Dispositivos GPS"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkReporteExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Clientes"></asp:Literal> <asp:Literal ID="LtlCliente" runat="server"></asp:Literal>
|
||||
|
||||
@@ -677,6 +677,7 @@ Partial Class Clientes
|
||||
TabOtros.Visible = False
|
||||
TabCuentasEquipos.Visible = True
|
||||
ReporteDispositivos.Visible = True
|
||||
LnkReporteExcel.Visible = True
|
||||
TabCuentasEquipos.HeaderText = "Equipos GPS"
|
||||
TabRH.Visible = False
|
||||
TabUsuarios.Visible = True
|
||||
@@ -3733,22 +3734,33 @@ Partial Class Clientes
|
||||
End Sub
|
||||
|
||||
Protected Sub GenerarReporte(sender As Object, e As EventArgs)
|
||||
GenerarRepCrystal()
|
||||
GenerarRepCrystal("PDF")
|
||||
End Sub
|
||||
Private Sub GenerarRepCrystal()
|
||||
Dim Archivo As New FileInfo(Server.MapPath("~/Empresas/Grales/Formatos/EquiposGPS.rpt"))
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("NombreUsuario", UsuarioActual.Nombre))
|
||||
|
||||
Protected Sub GenerarReporteExcel(sender As Object, e As EventArgs)
|
||||
GenerarRepCrystal("Excel")
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarRepCrystal(Formato As String)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("NombreUsuario", UsuarioActual.Usuario))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim tablaReporte As DataTable
|
||||
If ObjGPS.DispositivosGet(-1, Estatus, CveCliente) Then
|
||||
tablaReporte = ObjGPS.DtResultados
|
||||
Dim VistaFiltro As DataView = New DataView(tablaReporte)
|
||||
Dim reporteDatos As DataTable = VistaFiltro.ToTable("Selected", False, "TipoDispositivoDisplay", "Display", "Modelo", "Serie", "IMEI", "NumeroTelefono", "FechaIng")
|
||||
Dim file As Byte() = ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/EquiposGPS.rpt"), reporteDatos, lista)
|
||||
ImprimirbytesPDF(file)
|
||||
If ObjGPS.DispositivosGet(-1, DdlEstatusDispositivos.SelectedValue.ToEntero(), CveCliente) Then
|
||||
tablaReporte = ObjGPS.DtResultados
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/EquiposGPS.rdlc", tablaReporte, params, "Equipo GPS", Formato)
|
||||
Else
|
||||
Alert("No hay lista de dispositivos para imprimir")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user