Weird loop behavior when I pass parameter to reportviewer RRS feed

  • Question

  • Hi there,

    When I pass a parameter to the reportviewer control , then the page never display the report and keep in an infinite loop. What could causing this? There is no error anywhere..

    Below is my code:


    // Set the processing mode for the ReportViewer to Remote
              ReportViewer1.ProcessingMode = ProcessingMode.Remote;

              ServerReport serverReport = ReportViewer1.ServerReport;

              // Set the report server URL and report path
              serverReport.ReportServerUrl =
                  new Uri( "http://server/reportserver" );
              serverReport.ReportPath =

              // Create the sales order number report parameter
              ReportParameter parameter = new ReportParameter();
              parameter.Name = "ReportParameter1";
              parameter.Values.Add( "6" );
              parameter.Visible = true;

              // Set the report parameters for the report
              ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { parameter } );


    Thank you,

    Thursday, May 12, 2011 4:48 PM


  • I figure out the issue.


    You can't call SetParameters method in Page_load, this will cause an infinite loop. instead you need to call SetParameters in Page_init.


    More details:



    • Marked as answer by Joe.C Thursday, May 12, 2011 5:21 PM
    Thursday, May 12, 2011 5:20 PM