nuevo reporte para impresión del documento detalle
This commit is contained in:
@@ -16,7 +16,17 @@
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LkbNuevaVersion" OnClick="LkbNuevaVersion_Click" data-toggle="tooltip" data-placement="left" title="Agregar una nueva versión de este documento" Text="<i class='fa fa-plus'></i>Crear Nueva Versión"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LkbPDF" OnClick="LkbPDF_Click" data-toggle="tooltip" data-placement="left" title="ImprimirPDF" Text="<i class='fa fa-file-pdf-o'></i> PDF"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LkbExcel" OnClick="LkbExcel_Click" data-toggle="tooltip" data-placement="left" title="ImprimirExcel" Text="<i class='fa fa-file-excel-o'></i> Excel"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LkbPDF"/>
|
||||
<asp:PostBackTrigger ControlID="LkbExcel"/>
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
@@ -8,6 +8,7 @@ using Extensiones;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
{
|
||||
@@ -89,6 +90,19 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
ViewState["CveAsignacion"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private DataTable DtUsuariosParticipantes
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataTable) ViewState["DtUsuariosParticipantes"]);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["DtUsuariosParticipantes"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -149,6 +163,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento))
|
||||
{
|
||||
GvUsuarios.DataSource = ObjOI.DtResultados;
|
||||
DtUsuariosParticipantes = ObjOI.DtResultados;
|
||||
UsuariosAux = ObjOI.DtResultados;
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
@@ -300,7 +315,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
bool MostrarSegunEnProceso = (LblEstatus.Text == "Estatus: En Proceso");
|
||||
LkbActualizar.Visible = !(MostrarSegunRechazado) && (UsuarioActual.CveUsuario == this.CveUsuarioResponsable);
|
||||
DivBotonesAcciones.Visible = !(MostrarSegunAprobado || MostrarSegunRechazado);
|
||||
UpAgregar.Visible = MostrarSegunAprobado;
|
||||
LkbNuevaVersion.Visible = MostrarSegunAprobado;
|
||||
}
|
||||
|
||||
private void CargarCategorias()
|
||||
@@ -832,7 +847,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "Rechazar"
|
||||
#region "RECHAZAR"
|
||||
protected void LkbRechazar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
@@ -845,4 +860,40 @@ public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", this.CveDocumento, "Rechazado"));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "IMPRIMIR"
|
||||
private void Imprimir(string Formato)
|
||||
{
|
||||
List<ReportParameter> Params = new List<ReportParameter>();
|
||||
Params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
Params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
Params.Add(new ReportParameter("LogoPath", ""));
|
||||
Params.Add(new ReportParameter("Descripcion", TxtDescripcion.Text));
|
||||
Params.Add(new ReportParameter("Categoria", DdlCategoria.SelectedItem.Text));
|
||||
Params.Add(new ReportParameter("SubCategoria", DdlSubCategoria.SelectedItem.Text));
|
||||
Params.Add(new ReportParameter("Estatus", LblEstatus.Text.Substring(9)));
|
||||
Params.Add(new ReportParameter("Version", TxtVersion.Text));
|
||||
Params.Add(new ReportParameter("Responsable", TxtResponsable.Text));
|
||||
Params.Add(new ReportParameter("Observaciones", TxtObs.InnerText));
|
||||
Params.Add(new ReportParameter("Documento", this.ArchivoAdjuntoNombre));
|
||||
|
||||
|
||||
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
string LogoRuta = (Imagen.Exists) ? logouri : "" ;
|
||||
Params.Add(new ReportParameter("LogoPath", LogoRuta));
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepDocumentos.rdlc", this.DtUsuariosParticipantes, Params, "Detalle del documento", Formato);
|
||||
}
|
||||
|
||||
protected void LkbPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
Imprimir("PDF");
|
||||
}
|
||||
|
||||
protected void LkbExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Imprimir("Excel");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user