Unable to Connect to Report in Windows Form

Discussion in 'Databases' started by nileshgambhava, Sep 17, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have deployed report on my web hosting server and now I want to access it using Windows Form ? Report Viewer Control.
    </o:p>
    Following is the code which I use.
    </o:p>
    public Demo()
    {
    InitializeComponent();
    </o:p>
    reportViewer1.ProcessingMode = ProcessingMode.Remote;
    </o:p>
    reportViewer1.ServerReport.ReportServerUrl = new Uri("https://rs.hoster.net");
    reportViewer1.ServerReport.ReportPath = "/reports/CityList";

    reportViewer1.ShowCredentialPrompts = false;
    reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = new NetworkCredential("username", "password", "https://rs.hoster.net");
    reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
    reportViewer1.PromptAreaCollapsed = false;
    </o:p>
    reportViewer1.RefreshReport();
    </o:p>
    }
    </o:p>
    If I connect using wrong username or password then I got following message
    ?The request failed with HTTP status 401: Unauthorized.?
    </o:p>
    If I connect using correct username and password then I got following message
    </o:p>
    ?The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. The request failed with HTTP status 404. Not Found.?
    </o:p>
    I used Windows XP with SQL Server 2005 and SSRS 2005
     
  2. For Win Forms, the following should work just fine:

    [Note:Replace by Reporting Service username,password & domain . 'reportViewer' is your reportviewer control's ID]

    reportViewer.ServerReport.ReportServerCredentials.NetworkCredentials=new NetworkCredential(username, password, domain)
    reportViewer.RefreshReport();

    For web forms ;
    See: http://community.discountasp.net/default.aspx?f=16&m=17808

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 9/17/2007 11:49:02 PM GMT
     
  3. Kindly Please give bit more details. I didn't get it..
     
  4. See the attached Windows Application :
    Set the ReportPath (/[DASP_UserName]/reports/[your_report_name]) and ReportServerUrl (https://rs2k501.discountasp.net/ReportServer) property for the reportviewer control on the form . Also, in the code replace 'rs_username','rs_password' &amp; 'your_domain' values with appropriate ones.






    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     

    Attached Files:

  5. I have gone through your application but still no luck.

    I am sending my app with all data.

    Please let me know where I am making mistakes..
     

    Attached Files:

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