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>
<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>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel "></i> Excel</asp:LinkButton>
</li>

View File

@@ -5,7 +5,9 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class General_CATIEPSxEntidadFed : ClsPaginas
using Microsoft.Reporting.WebForms;
using System.Data;
public partial class General_CATIEPSxEntidadFed : ClsPaginas
{
#region Propiedades
private int RAgrupador
@@ -25,15 +27,18 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
}
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; }
}
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; }
}
private DataTable DtIEPS{
get { return (ViewState["DtIEPS"] == null) ? null : (DataTable)(ViewState["DtIEPS"]); }
set { ViewState["DtIEPS"] = value; }
}
#endregion
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();
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();
DdlEstado .SelectedValueExist( RcveEstado.ToString());
DdlIeps.SelectedValueExist ( RtasaIEPS.ToString());
DdlEstado.SelectedValueExist(RcveEstado.ToString());
DdlIeps.SelectedValueExist(RtasaIEPS.ToString());
TxtIEPSfechaInicio.Text = $"{RfechaInicio:dd/MM/yyyy}";
TxtIEPSfechaFin.Text = $"{RfechaFin:dd/MM/yyyy}";
@@ -65,6 +70,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
ClsGenerales ObjIEPS = new ClsGenerales();
ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador);
GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados;
DtIEPS = ObjIEPS.DtResultados;
ObjIEPS.Dispose();
GVIEPSxEntidadFed.DataBind();
upDatosIEPS.Update();
@@ -73,7 +79,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
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();
if (cveGrupo == 1)
@@ -92,14 +98,25 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas
RAgrupador = DdlAgrupador.SelectedValue.ToEntero();
RcveEstado = DdlEstado.SelectedValue.ToEntero();
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");
CargaIEPSxEntidadFed();
CargaIEPSxEntidadFed();
}
protected void LnkExcel_Click(object sender, EventArgs e)
{
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");
}
}