none
点击reportviewer中的跳转项,居然在里面跳出了reportviewer控件 RRS feed

  • 一般討論

  • when I try to use reportviewer(remote) to display some reports in reporting service,I do it as the following steps:(the effect I need is when an item,for example a hypelink item, in the report "A" displayed in a reportviewer in web page "reportA.aspx"  is clicked, a new page "reportB.aspx" displays another reportviewer showing a new report "B" which is a "Drillthrough" report of the former one)

    1.Get the parameters for report "A",for example

    this.ReportViewerA.ServerReport.ReportServerUrl ="http://localhost/reportserver";

    this.ReportViewerA..ServerReport.ReportPath = "XXXXXXX";

    //get the destination page "reportB.aspx"

    string url = null;
            string req_url = this.Request.Url.ToString();
            int pos = req_url.LastIndexOf('/');
            if (pos > 0)
            {
                url = req_url.Substring(0, pos + 1) + "reportB.aspx";
            }

    ReportParameter paramScanID = new ReportParameter("ScanID", "1326");

    ReportParameter paramUrl = new ReportParameter("Url", url);
            this.ReportViewerA.ServerReport.SetParameters(new ReportParameter[] { paramScanID, paramUrl });
            this.ReportViewerA.ServerReport.Refresh();

     

    2.before step 1,first we new 2 report parameter for ReportA "ScanID"--for filtering, and "Url"--identify the destination page.

    Then set Action/Navigation item as follows:

    = Parameters!url.Value & "?ScanID=" & Fields!Scan.Value 

     

    3,in the ReportB.aspx.cs ,

    we get the parameters from url and set the parameters for ReportB.

     

    My question is:

    When the page reportA.aspx come out ,the reportA is showed.But if I do something such as refresh or click to expand a item in report A, then click the hypeLink item in the report, then Page reportB.aspx is showed in reportviewerA instead of a new page.But if i don't do any thing on reportA, and just click the hypeLick item, a new page of reportB can be showed,

    {the property "HypeLickTarget " is set "_blank" in my project}

    How can I avoid the bad situation above.

    Thank you!

    2007年1月15日 上午 03:15