-
This commit is contained in:
@@ -16,7 +16,17 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton runat="server" ID="BtnAgregarContratoModal" data-toggle="tooltip" data-placement="left" title="Agregar Contrato " Text="<i class='fa fa-plus'></i> Agregar Contrato"></asp:LinkButton>
|
<asp:LinkButton runat="server" ID="BtnAgregarContratoModal" data-toggle="tooltip" data-placement="left" title="Agregar Contrato " Text="<i class='fa fa-plus'></i> Agregar Contrato"></asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-file-pdf-o"></i> PDF</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||||
|
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||||
|
</Triggers>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Linq
|
Imports System.Linq
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
|
||||||
Partial Class Proveedores_Contratos
|
Partial Class Proveedores_Contratos
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -20,6 +21,15 @@ Partial Class Proveedores_Contratos
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected Property DtDatos As DataTable
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("DtDatos"), DataTable)
|
||||||
|
End Get
|
||||||
|
Set(value As DataTable)
|
||||||
|
ViewState("DtDatos") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
@@ -39,6 +49,7 @@ Partial Class Proveedores_Contratos
|
|||||||
|
|
||||||
If ObjProv.GetContrato(-1, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlProveedorFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa) Then
|
If ObjProv.GetContrato(-1, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlProveedorFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||||
GvDatos.DataSource = ObjProv.DtResultados
|
GvDatos.DataSource = ObjProv.DtResultados
|
||||||
|
DtDatos = ObjProv.DtResultados
|
||||||
Else
|
Else
|
||||||
GvDatos.DataSource = Nothing
|
GvDatos.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
@@ -329,4 +340,31 @@ Partial Class Proveedores_Contratos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPDF.Click
|
||||||
|
Imprimir("PDF")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
|
Imprimir("Excel")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Imprimir(Formato As String)
|
||||||
|
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 Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
|
|
||||||
|
Dim params As New List(Of ReportParameter)
|
||||||
|
|
||||||
|
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||||
|
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||||
|
|
||||||
|
Dim Filtro As String = String.Format("<b>{0}: </b>{1}   <b>Proveedor: </b>{2}   <b>Tipo Contrato: </b>{3}", LblSubProyectoFiltro.Text, DdlSubProyectoFiltro.SelectedItem.Text, DdlProveedorFiltro.SelectedItem.Text, DdlTipoContratoFiltro.SelectedItem.Text)
|
||||||
|
params.Add(New ReportParameter("Filtro", Filtro))
|
||||||
|
If Imagen.Exists Then
|
||||||
|
params.Add(New ReportParameter("LogoPath", logouri))
|
||||||
|
Else
|
||||||
|
params.Add(New ReportParameter("LogoPath", logouri))
|
||||||
|
End If
|
||||||
|
ImprimirPDF("Empresas/Grales/Formatos/RepContratosGen.rdlc", DtDatos, params, "Reporte de Contratos", Formato)
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user