How send credentials using ReportViewerForMVC

SSRS-VS 41 Reputation points
2023-05-15T12:30:18.48+00:00

I want to see my reports in my asp.net MVC web project. For this task, I'm using the nugget extension: ReportViewerForMVC

SSRS server and the .net web project are in different computers:

This is my controller:

imagen

And this is the view:

imagen

And I'm getting this error:

Server Error in '/' Application. The request failed with HTTP status 401: Unauthorized. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The request failed with HTTP status 401: Unauthorized. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [WebException: The request failed with HTTP status 401: Unauthorized.] Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods() +192 Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname) +51
Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.SetConnectionSSLForMethod(String methodname) +12
Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ProxyMethodInvocation.Execute(RSExecutionConnection connection, ProxyMethod1 initialMethod, ProxyMethod1 retryMethod) +449 Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID) +180
Microsoft.Reporting.WebForms.SoapReportExecutionService.LoadReport(String report, String historyId) +24
Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession() +70 Microsoft.Reporting.WebForms.ServerReport.GetParameters() +54
ReportViewerForMvc.ReportViewerExtensions.SetProperties(ServerReport serverReport, ServerReport properties) +60
ReportViewerForMvc.ReportViewerExtensions.SetProperties(ReportViewer reportViewer, ReportViewer properties) +154
ReportViewerForMvc.ReportViewerWebForm.BuildReportViewer() +67
ReportViewerForMvc.ReportViewerWebForm.Page_Load(Object sender, EventArgs e) +5
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52 System.Web.UI.Control.OnLoad(EventArgs e) +97
System.Web.UI.Control.LoadRecursive() +61
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693

I think this is because of the credentials, so now I'm using this to send the credentials (I guess that domain parameter is the windows domain on the ssrs server pc, right?):

imagen

User's image

But I'm getting the error "empty respond":

Server error in application '/'.
The request failed with an empty response.
Description: Unhandled exception executing the current web request. Review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: Request failed with an empty response.

Source code error:

An unhandled exception was thrown during the execution of the current web request. Information about the source and location of the exception can be identified using the exception stack trace below.

Stack trace:


[WebException: Request failed with an empty response.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +183224
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +221
   Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ReportExecutionService.LoadReport3(String Report, String HistoryID) +63
   Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.<>c__DisplayClass3.<LoadReport>b__0() +18
   Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ProxyMethodInvocation.Execute(RSExecutionConnection connection, ProxyMethod`1 sql16Method, ProxyMethod`1 katmaiMethod, ProxyMethod`1 yukonMethod) +566
   Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID) +241
   Microsoft.Reporting.WebForms.SoapReportExecutionService.LoadReport(String report, String historyId) +24
   Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession() +121
   Microsoft.Reporting.WebForms.ServerReport.GetParameters() +53
   ReportViewerForMvc.ReportViewerExtensions.SetProperties(ServerReport serverReport, ServerReport properties) +60
   ReportViewerForMvc.ReportViewerExtensions.SetProperties(ReportViewer reportViewer, ReportViewer properties) +154
   ReportViewerForMvc.ReportViewerWebForm.BuildReportViewer() +67
   ReportViewerForMvc.ReportViewerWebForm.Page_Load(Object sender, EventArgs e) +5
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693

I need help.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,475 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,349 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AniyaTang-MSFT 5,471 Reputation points Microsoft Vendor
    2023-05-16T01:55:08.2833333+00:00

    Hi @SSRS-VS

    I don't know much about asp.net, about SSRS authentication, you can refer to this link: https://learn.microsoft.com/en-us/sql/reporting-services/extensions/security-extension/authentication-in-reporting-services?view=sql-server-ver16.

    Best regards,

    Aniya

    0 comments No comments