How to run a RS2005 report from code?

Discussion in 'ASP.NET / ASP.NET Core' started by arby, May 14, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Does anyone have a code sample of how to programmically access a report in the DASP environment? Ideally I would like to set the datasource and datasource credentials via code. I can get to work locally but when I try to connect to my DASP RS2005, I keep getting the following errorwhen I'm setting the report parameters:




    The request failed with HTTP status 404: Not Found.</BLOCKQUOTE>
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    What is the report parameter you used?

    Post your code as well.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     

  3. In an attempt to have one set of reports run against multiple DBs, I'mdynamically changing the connection string which is the first parameter in the report. It worksOK in development accessing a local RS2005 instance but not when I try against my DASP RS2005 instance. The 404 occurs on the last line in my code snipet. If you have a working sample, can you please share it?

    Here's the code:


    ReportViewer1.ProcessingMode = ProcessingMode.Remote</BLOCKQUOTE>
    Dim serverReport As ServerReport
    serverReport = ReportViewer1.ServerReport
    serverReport.ReportServerUrl = _
    New Uri("https://rs2k501.discountasp.net/reports/")
    serverReport.ReportPath = "home/rootname/SampleReport"


    Dim sConnString As String
    sConnString = ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString</BLOCKQUOTE>
    Dim connectionString As New ReportParameter()
    connectionString.Name = "ConnectionString"
    connectionString.Values.Add(sConnString)

    Dim parameters() As ReportParameter = {connectionString}
    serverReport.SetParameters(parameters)
     
  4. Bruce

    Bruce DiscountASP.NET Staff

  5. I get the same error message.
     
  6. Changing the URL works....Thank you!
     
  7. Bruce

    Bruce DiscountASP.NET Staff

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page