imprimir reporte en excel y pdf
This commit is contained in:
@@ -15,6 +15,12 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Etapas de Proceso</span></asp:LinkButton>
|
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Etapas de Proceso</span></asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkImprimir" OnClick="LnkImprimir_Click" runat="server"><i class="fa fa-file-pdf-o"></i><span style="padding-left:5px;">PDF</span></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Web;
|
|||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using Microsoft.Reporting.WebForms;
|
||||||
|
|
||||||
using Extensiones;
|
using Extensiones;
|
||||||
|
|
||||||
@@ -317,4 +318,36 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
|
|||||||
CargaDatos(DdlFiltroProceso.SelectedValue.ToEntero());
|
CargaDatos(DdlFiltroProceso.SelectedValue.ToEntero());
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
protected void LnkImprimir_Click(object sender,EventArgs e)
|
||||||
|
{
|
||||||
|
Imprimir("PDF");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkImprimirExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Imprimir("EXCEL");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Imprimir(string formato)
|
||||||
|
{
|
||||||
|
System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||||
|
string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||||
|
|
||||||
|
List<ReportParameter> param = new List<ReportParameter>();
|
||||||
|
|
||||||
|
param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||||
|
if (Image.Exists)
|
||||||
|
{
|
||||||
|
param.Add(new ReportParameter("LogoPath", logouri));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param.Add(new ReportParameter("LogoPath", ""));
|
||||||
|
}
|
||||||
|
param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||||
|
param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString()));
|
||||||
|
|
||||||
|
ImprimirPDF("Empresas/Grales/Formatos/RepCatEtapasProceso.rdlc", TmpDT, param, "Report Cat Etapas Proceso", formato);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,12 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Probabilidad de Acercamiento</span></asp:LinkButton>
|
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Probabilidad de Acercamiento</span></asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkImprimir" OnClick="LnkImprimir_Click" runat="server"><i class="fa fa-file-pdf-o"></i><span style="padding-left:5px;">PDF</span></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkImprimirExcel" OnClick="LnkImprimirExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i><span style="padding-left:5px;">Excel</span></asp:LinkButton>
|
||||||
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Web;
|
|||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using Microsoft.Reporting.WebForms;
|
||||||
|
|
||||||
using Extensiones;
|
using Extensiones;
|
||||||
|
|
||||||
@@ -195,4 +196,35 @@ public partial class CRM_CatProbabilidadAcercamiento : ClsPaginas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
protected void LnkImprimir_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Imprimir("PDF");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkImprimirExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Imprimir("EXCEL");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Imprimir(string formato)
|
||||||
|
{
|
||||||
|
System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||||
|
string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||||
|
|
||||||
|
List<ReportParameter> param = new List<ReportParameter>();
|
||||||
|
|
||||||
|
param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||||
|
if (Image.Exists)
|
||||||
|
{
|
||||||
|
param.Add(new ReportParameter("LogoPath", logouri));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param.Add(new ReportParameter("LogoPath", ""));
|
||||||
|
}
|
||||||
|
param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||||
|
param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString()));
|
||||||
|
|
||||||
|
ImprimirPDF("Empresas/Grales/Formatos/RepCatProbabilidadAcercamiento", TmpDT, param, "Report Cat Etapas Proceso", formato);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user