请教高手:我有一页面专门用来显示Reporting Service的Report。它在Page_Load时取得传入参数,然后进行显示,但有个很奇怪的问题:报表显示出来后每次更换查询条件都要点击两次才能显示下面的内容。点击一次报表区显示为空白,再点击一次就正常显示。没有更换查询条件就没有问题。
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
string url = this.Request.QueryString["ReportUrl"];
string path = this.Request.QueryString["ReportPath"];
if (url != null && path != null)
{
Uri uri = new Uri(url);
this.ReportViewer1.ServerReport.ReportServerUrl = uri;
this.ReportViewer1.ServerReport.ReportPath = path;
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
string url = this.Request.QueryString["ReportUrl"];
string path = this.Request.QueryString["ReportPath"];
if (url != null && path != null)
{
Uri uri = new Uri(url);
this.ReportViewer1.ServerReport.ReportServerUrl = uri;
this.ReportViewer1.ServerReport.ReportPath = path;
}
}
}
临时解决方案:去掉那两个隐藏的TextBox.