using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.Reporting.WebForms;namespace HumanpoolReport_V1._0.Reporting_Service
{
public partial class 员工信息查询 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string frameHeight = "800px";
this.ReportViewer1.Height = new Unit(frameHeight);
this.ReportViewer1.Width = ReportCommon.ReportWidth;
this.ReportViewer1.ProcessingMode = ProcessingMode.Remote;
this.ReportViewer1.Drillthrough+=new DrillthroughEventHandler(ReportViewer1_Drillthrough); string strReportRDL = "员工信息查询";
string strReportServerURL = ReportCommon.ReportServerURL;
string StandardReportPath = ReportCommon.StandardReportPath;
this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(ReportCommon.ReportServerURL.ToString());
this.ReportViewer1.ServerReport.ReportPath = StandardReportPath + "/" + strReportRDL; string EmName = Request.QueryString["EmName"];
string TitleCN = Request.QueryString["TitleCN"];
string IdCardCode = Request.QueryString["IdCardCode"];
string Gender = Request.QueryString["TitleCN as Gender"];
string Birthday = Request.QueryString["Birthday"];
string Ewstatus = Request.QueryString["Ewstatus"];
string CustomerName = Request.QueryString["CustomerName"];
string ContactMobilePhone = Request.QueryString["ContactMobilePhone"];
string ResidenceAddress = Request.QueryString["ResidenceAddress"];
ReportParameter[] arrRptParameExport = new ReportParameter[]
{
new ReportParameter("EmName",EmName),
new ReportParameter("TitleCN",TitleCN),
new ReportParameter("IdCardCode",IdCardCode),
new ReportParameter("Gender",Gender),
new ReportParameter("Birthday",Birthday),
new ReportParameter("Ewstatus",Ewstatus),
new ReportParameter("CustomerName",CustomerName),
new ReportParameter("ContactMobilePhone",ContactMobilePhone),
new ReportParameter("ResidenceAddress",ResidenceAddress)
};
//this.ReportViewer1.ServerReport.SetParameters(arrRptParameExport);
this.ReportViewer1.Visible = true;
}
}
protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{
}
}
}
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.Reporting.WebForms;namespace HumanpoolReport_V1._0.Reporting_Service
{
public partial class 员工信息查询 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string frameHeight = "800px";
this.ReportViewer1.Height = new Unit(frameHeight);
this.ReportViewer1.Width = ReportCommon.ReportWidth;
this.ReportViewer1.ProcessingMode = ProcessingMode.Remote;
this.ReportViewer1.Drillthrough+=new DrillthroughEventHandler(ReportViewer1_Drillthrough); string strReportRDL = "员工信息查询";
string strReportServerURL = ReportCommon.ReportServerURL;
string StandardReportPath = ReportCommon.StandardReportPath;
this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(ReportCommon.ReportServerURL.ToString());
this.ReportViewer1.ServerReport.ReportPath = StandardReportPath + "/" + strReportRDL; string EmName = Request.QueryString["EmName"];
string TitleCN = Request.QueryString["TitleCN"];
string IdCardCode = Request.QueryString["IdCardCode"];
string Gender = Request.QueryString["TitleCN as Gender"];
string Birthday = Request.QueryString["Birthday"];
string Ewstatus = Request.QueryString["Ewstatus"];
string CustomerName = Request.QueryString["CustomerName"];
string ContactMobilePhone = Request.QueryString["ContactMobilePhone"];
string ResidenceAddress = Request.QueryString["ResidenceAddress"];
ReportParameter[] arrRptParameExport = new ReportParameter[]
{
new ReportParameter("EmName",EmName),
new ReportParameter("TitleCN",TitleCN),
new ReportParameter("IdCardCode",IdCardCode),
new ReportParameter("Gender",Gender),
new ReportParameter("Birthday",Birthday),
new ReportParameter("Ewstatus",Ewstatus),
new ReportParameter("CustomerName",CustomerName),
new ReportParameter("ContactMobilePhone",ContactMobilePhone),
new ReportParameter("ResidenceAddress",ResidenceAddress)
};
//this.ReportViewer1.ServerReport.SetParameters(arrRptParameExport);
this.ReportViewer1.Visible = true;
}
}
protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{
}
}
}
还有个数据源绑定
设置数据源对象 可以定义 参数
实现报表