请教高手:我有一页面专门用来显示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;
                }
            }
        }

解决方案 »

  1.   

    现在有点线索了:应该是Reporting Service的报表查询条件对应的TextBox有onChange事件(通过看HTML知道的)。但这个事件在Report Service的报表管理器内直接查看的时候没有呀???
      

  2.   

    知道问题了。Reporting Service内有两个隐藏的TextBox,设置成为了值等于另一可见的TextBox内容,所以用户在输入查询条件后触发了TextBox的Changed事件,导致问题出现。
    临时解决方案:去掉那两个隐藏的TextBox.