agregando rdlc al reporte

This commit is contained in:
Antonio Gonzalez
2020-02-18 16:37:42 -07:00
parent 06fae5cf98
commit 8b7f550b15
2 changed files with 30 additions and 10 deletions

View File

@@ -15,6 +15,9 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkPDF" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-ad-pdf "></i> PDF</asp:LinkButton>
</li>
<li> <li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel "></i> Excel</asp:LinkButton> <asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel "></i> Excel</asp:LinkButton>
</li> </li>

View File

@@ -5,7 +5,9 @@ using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using Extensiones; using Extensiones;
public partial class General_CATIEPSxEntidadFed : ClsPaginas using Microsoft.Reporting.WebForms;
using System.Data;
public partial class General_CATIEPSxEntidadFed : ClsPaginas
{ {
#region Propiedades #region Propiedades
private int RAgrupador private int RAgrupador
@@ -25,15 +27,18 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
} }
private string RfechaInicio private string RfechaInicio
{ {
get { return (ViewState["RfechaInicio"] == null) ? "-1": (ViewState["RfechaInicio"]).ToString(); } get { return (ViewState["RfechaInicio"] == null) ? "-1" : (ViewState["RfechaInicio"]).ToString(); }
set { ViewState["RfechaInicio"] = value; } set { ViewState["RfechaInicio"] = value; }
} }
private string RfechaFin private string RfechaFin
{ {
get { return (ViewState["RfechaFin"] == null) ? "-1": (ViewState["RfechaFin"]).ToString(); } get { return (ViewState["RfechaFin"] == null) ? "-1" : (ViewState["RfechaFin"]).ToString(); }
set { ViewState["RfechaFin"] = value; } set { ViewState["RfechaFin"] = value; }
} }
private DataTable DtIEPS{
get { return (ViewState["DtIEPS"] == null) ? null : (DataTable)(ViewState["DtIEPS"]); }
set { ViewState["DtIEPS"] = value; }
}
#endregion #endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
@@ -50,8 +55,8 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal(); RtasaIEPS = Request["tasaIEPS"] == null ? -1 : Request["tasaIEPS"].ToString().ToDecimal();
RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString(); RfechaInicio = Request["fechaInicio"] == null ? string.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1)) : Request["fechaInicio"].ToString();
RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString(); RfechaFin = Request["fechaFin"] == null ? string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()) : Request["fechaFin"].ToString();
DdlEstado .SelectedValueExist( RcveEstado.ToString()); DdlEstado.SelectedValueExist(RcveEstado.ToString());
DdlIeps.SelectedValueExist ( RtasaIEPS.ToString()); DdlIeps.SelectedValueExist(RtasaIEPS.ToString());
TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}"; TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}";
TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}"; TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}";
@@ -65,6 +70,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
ClsGenerales ObjIEPS = new ClsGenerales(); ClsGenerales ObjIEPS = new ClsGenerales();
ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador); ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador);
GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados; GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados;
DtIEPS = ObjIEPS.DtResultados;
ObjIEPS.Dispose(); ObjIEPS.Dispose();
GVIEPSxEntidadFed.DataBind(); GVIEPSxEntidadFed.DataBind();
upDatosIEPS.Update(); upDatosIEPS.Update();
@@ -73,7 +79,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e) protected void GVIEPSxEntidadFed_RowDataBound(object sender, GridViewRowEventArgs e)
{ {
if(e.Row.RowType == DataControlRowType.DataRow) if (e.Row.RowType == DataControlRowType.DataRow)
{ {
int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero(); int cveGrupo = e.Row.DBCampo("CveGrupo").ToEntero();
if (cveGrupo == 1) if (cveGrupo == 1)
@@ -92,7 +98,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
RAgrupador = DdlAgrupador.SelectedValue.ToEntero(); RAgrupador = DdlAgrupador.SelectedValue.ToEntero();
RcveEstado = DdlEstado.SelectedValue.ToEntero(); RcveEstado = DdlEstado.SelectedValue.ToEntero();
RtasaIEPS = DdlIeps.SelectedValue.ToDecimal(); RtasaIEPS = DdlIeps.SelectedValue.ToDecimal();
RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd") ; RfechaInicio = TxtIEPSfechaInicio.Text.ToDate().ToString("yyyy/MM/dd");
RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd"); RfechaFin = TxtIEPSfechaFin.Text.ToDate().ToString("yyyy/MM/dd");
CargaIEPSxEntidadFed(); CargaIEPSxEntidadFed();
@@ -102,4 +108,15 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
{ {
GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa"); GVIEPSxEntidadFed.ExportToExcelx("IEPS porEntidad Federativa");
} }
protected void LnkPDF_Click(object sender, EventArgs e)
{
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("Logo", String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)));
paramList.Add(new ReportParameter("FechaInicio", TxtIEPSfechaInicio.Text));
paramList.Add(new ReportParameter("FechaFin", TxtIEPSfechaFin.Text));
paramList.Add(new ReportParameter("Agrupador", DdlAgrupador.SelectedValue));
ImprimirPDF("Empresas/Grales/Formatos/CatIepsEntidadFed.rdlc", DtIEPS, paramList,"IEPS por entidades federativa",RDSName:"DsInventarios");
}
} }