SSRS report viewer showing response "The request failed with an empty response"

Kumaranath Fernando 41 Reputation points
2021-01-01T10:08:51.517+00:00

My goal is to display a report from remote ssrs report server. I'm attempting to display a sample report on ASP.NET MVC framework.
N.B I'm able to view the report on the browser with user authentication.

On the runReport.aspx I have the following.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="runReports.aspx.cs" Inherits="WebClient.reports.runReporting" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form runat="server">
        <asp:ScriptManager runat="server"></asp:ScriptManager>
        <rsweb:ReportViewer ID="MainReportViewer" runat="server" BackColor="White"
            Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos=" (Collection)"
            ProcessingMode="Remote" ShowBackButton="False" ShowFindControls="False"
            ShowPageNavigationControls="False" SizeToReportContent="True"
            ToolBarItemBorderColor="White" ToolBarItemHoverBackColor="White"
            WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%">
            <ServerReport ReportServerUrl="" />
        </rsweb:ReportViewer>
    </form>
</body>
</html>

On the code behind

protected void Page_Load(object sender, EventArgs e)        {            
        MainReportViewer.ProcessingMode = ProcessingMode.Remote; 
        IReportServerCredentials irsc = new CustomReportCredentials("username", "password", "https://servername.com"); 
        MainReportViewer.ServerReport.ReportServerCredentials = irsc;  
        MainReportViewer.ServerReport.ReportServerUrl = new Uri("https://servername.com/reports");  
        MainReportViewer.ServerReport.ReportPath = "/report/Sample_Report_Project" + "/" + "Report_1";       
}

On CustomReportCredentials.cs

public class CustomReportCredentials : IReportServerCredentials
    {
        private string _UserName;
        private string _PassWord;
        private string _DomainName;

        public CustomReportCredentials(string UserName, string PassWord, string DomainName)
        {
            _UserName = UserName;
            _PassWord = PassWord;
            _DomainName = DomainName;
        }

        public System.Security.Principal.WindowsIdentity ImpersonationUser
        {
            get { return null; }
        }

        public ICredentials NetworkCredentials
        {
            get { return new NetworkCredential(_UserName, _PassWord, _DomainName); }
        }

        public bool GetFormsCredentials(out Cookie authCookie, out string user,
         out string password, out string authority)
        {
            authCookie = null;
            user = password = authority = null;
            return false;
        }
    }
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 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,855 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 34,836 Reputation points
    2021-01-04T05:59:13.57+00:00

    Hi @Kumaranath Fernando ,

    Please check the code behind:

    MainReportViewer.ServerReport.ReportServerUrl = new Uri("https://servername.com/reports");  
    

    The report server url should be web service url not web portal url.

    Which means the new Uri needs to be like ("https://<Server Name>/reportserver").

    Please have a double check.

    You may refer the documentation for details.

    Use the WebForms ReportViewer Control

    Regards,
    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    What can I do if my transaction log is full?--- Hot issues November

    How to convert Profiler trace into a SQL Server table -- Hot issues November

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Kumaranath Fernando 41 Reputation points
    2021-01-04T07:15:30.267+00:00

    Thanks. Now I see a form for the report, similar to what I see normally on the browser, however this time when I try with the form with params I'm not able to view the report. @ZoeHui-MSFT 53211-screen-shot-2021-01-04-at-141423.png


  2. Kumaranath Fernando 41 Reputation points
    2021-01-04T07:46:41.9+00:00

    @ZoeHui-MSFT . There is no error message when I select the parameters from the form and submit it, It shows that it is "Loading", and after it completes it's just a blank report