locked
Is it possible to write a custom control which will auto re direct a SSRS report? RRS feed

  • Question

  • Is it possible to write a custom control which will auto re direct a SSRS report?
    Mr Shaw
    Thursday, November 18, 2010 4:55 PM

Answers

  • Hi Mr Shaw,

    We could redirect to SSRS report utilizing some custom control, you could also pass some paramters to the report, for example, you could add a button control to your webapplication, then add following code in the code-hehind, please make sure you give the correct report URL on the Report Server.

        protected void Button1_Click(object sender, EventArgs e)
        {
          ReportParameter rp0 = new ReportParameter("Category", "Bike");
          ReportParameter rp1 = new ReportParameter("SubCategory", "Mountain+Bike");
          TextBox1.Visible = true;
          
    
          Response.Redirect("http://vyof1886382/ReportServer_YOUHOO?/DemoTest/SteppedLayoutReport&rs:Command=Renderrc:&Category=" + rp0.Values[0].ToString()+ "&SubCategory=" + rp1.Values[0].ToString());
        }
    
    

    Thanks,
    Challen Fu

    • Marked as answer by Challen Fu Monday, November 29, 2010 1:23 AM
    Monday, November 22, 2010 7:53 AM

All replies

  • Hi Mr Shaw,

    We could redirect to SSRS report utilizing some custom control, you could also pass some paramters to the report, for example, you could add a button control to your webapplication, then add following code in the code-hehind, please make sure you give the correct report URL on the Report Server.

        protected void Button1_Click(object sender, EventArgs e)
        {
          ReportParameter rp0 = new ReportParameter("Category", "Bike");
          ReportParameter rp1 = new ReportParameter("SubCategory", "Mountain+Bike");
          TextBox1.Visible = true;
          
    
          Response.Redirect("http://vyof1886382/ReportServer_YOUHOO?/DemoTest/SteppedLayoutReport&rs:Command=Renderrc:&Category=" + rp0.Values[0].ToString()+ "&SubCategory=" + rp1.Values[0].ToString());
        }
    
    

    Thanks,
    Challen Fu

    • Marked as answer by Challen Fu Monday, November 29, 2010 1:23 AM
    Monday, November 22, 2010 7:53 AM
  • Is it possible to do a direct when the user clicks the View Report Button after selecting the report parameters?
    Mr Shaw
    Monday, November 22, 2010 10:39 AM
  • Hi Mr Shaw,

    It is also possible, but you have to set the parameters' value for the server report just like below code:

            ReportParameter rp0 = new ReportParameter("Report_Parameter_UserName", User.Identity.Name);
            ReportParameter rp1 = new ReportParameter("Title", Chart1.Title);
            ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { rp0, rp1 });
            ReportViewer1.ServerReport.Refresh();
    

     

    Thanks,
    Challen Fu

    Wednesday, November 24, 2010 1:48 AM
  • Are you talking about making my own Report Viewer?

     

    I am using the standard SSRS Report Manager. 


    Mr Shaw
    Wednesday, November 24, 2010 5:49 PM
  • Hi Mr Shaw,

    If you want to view the report on the report manager, you just need to select the parameters' value, then press the View report button, then you will see the report, if you want to write a custom control which will auto re direct a SSRS report, then you might should create a webapplication, built your own custom control, then set a remote model to display the reports which have been deployed on the report server.

    Thanks,
    Challen Fu   

    Thursday, November 25, 2010 2:27 AM