0
votes

I am developing a web application using Asp.net & c#. To generate a reports i am using SQL Server Business Intelligence Development Studio(ssrs).I get a error like "the request failed with http status 401 unauthorized" please help me thanks in advance The actual error is as follows

ex = {"The request failed with HTTP status 401: Unauthorized."}

{System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods() at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname) at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.SetConnectionSSLForMethod(String methodname) at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod1 initialMethod, ProxyMethod1 retryMethod) at Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID) at Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession() at Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters) at Microsoft.Reporting.WebForms.Report.SetParameters(ReportParameter parameter) at Reports_CustomerWtrEff.GetReports(String SampleCodes, String lstSampleCode) in CustomerWtrEff.aspx.cs:line 98}

2
try to wrap your the code with Thread or to impersonat it see http://iwillsharemypoint.blogspot.co.il/2011/04/ntlm-problam-request-failed-with-http.htmlroi

2 Answers

3
votes

Check out this link below, as it could lend an answer to your problem.

REF: http://www.taznetworks.com/rss/2006/03/crm-30-sbe-sql-reporting-error.html

EDIT:

In doing some work with CRM recently on some test installs we kept coming up with the error that "Setup failed to validate specified Reporting Services Report Server https://server.xxx.com/ReportServer. Error: The request failed with HTTP status 401: Unauthorized.

This seems to be a pretty common problem out there but not a lot of response to the issues. One thing I can say is that CRM is a good product but man is it complex in the guts of it. Not for the faint of heart that's for sure, especially when it comes to SQL and SQL reporting services.

Anyway back to the problem. In most cases with CRM 3 and SBS the documentation at such sites as Anne Stanton's show a problem with ISA. This box we were building didn't have ISA (as of yet).

The problem we were experiencing seems to be more with SP1 of Windows Server 2003 than anything else. The KB article 896861 seems to be spot on. We did the following according to the article:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.

Doing this allowed us to get to https://servername/reports and show the full SQL Reporting Services web site. CRM Reports now work as they were meant to.

0
votes

I faced this issue and tried more and more and finally found that

  1. open the reporting service configuration and connect to server then open web service url you will find the url copy it (URL)

  2. open your SQL server data tools project and in the project properties target server URL is the mentioned URL in the reporting service configuration and target report folder is the name of the project

  3. in your asp.net project you will write the following code:

.

ReportViewer1.ProcessingMode = 
Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri(**URL**);
ReportViewer1.ServerReport.ReportPath = String.Concat(**target report folder**, "name of the report ");
ReportViewer1.ServerReport.Refresh();