Simple Web Page To Display SSRS Report From Everleap Report Server Failing

Discussion in 'General troubleshooting' started by Randall, Dec 14, 2018.

  1. Hi, happy holidays (I hope?) !

    My Everleap accounts shows that the reportserver is:

    Report Server URL: https://rs02.everleap.com
    Root Path: /RS_4325/reports/

    So, I've deployed a simple report to the URL + folder where my Everleap account advises:
    TargetServerURL: https://rs02.everleap.com/ReportServer
    TargetReportFolder: /RS_4325/reports/

    Based on this information, in Visual Studio, I create a simple web page as follows, to access the report:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:scriptmanager runat="server"></asp:scriptmanager>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote">
    <ServerReport ReportPath="/RS_4325/reports/" ReportServerUrl="https://rs02.everleap.com" />
    </rsweb:ReportViewer>
    </form>
    </body>
    </html>

    And get the following error message:


    The request failed with the error message: -- <head><title>Document Moved</title></head> <body><h1>Object Moved</h1>This document may be found <a HREF="https://rs02.everleap.com/reports">here</a></body>

    I then changed the ReportServerURL to https://rs02.everleap.com/reports, and reran and get the following:

    • The request failed with HTTP status 401: Unauthorized.
    Any ideas on how to get this thing to show up in my web page? Am I close? Thank!
     
  2. To update, I've also added code behind to the same webpage as follows:

    protected void Page_Init(object sender, EventArgs e)
    {
    if (!Page.IsPostBack)
    {
    // Set the processing mode for the ReportViewer to Remote
    ReportViewer1.ProcessingMode = ProcessingMode.Remote;
    ServerReport serverReport = ReportViewer1.ServerReport;
    ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials("mysetupUserId", "password");//"NYCity1975");
    // Set the report server URL and report path
    serverReport.ReportServerUrl =
    new Uri("https://rs02.everleap.com/reports");
    serverReport.ReportPath =
    "/RS_4325/Report1.rdl";
    // Create the sales order number report parameter
    ReportParameter N = new ReportParameter();
    N.Name = "param1Name";
    N.Values.Add("10");
    // Create the sales order number report parameter
    ReportParameter metric = new ReportParameter();
    metric.Name = "Param2Name";
    metric.Values.Add("AValue");
    // Create the sales order number report parameter
    ReportParameter cityList = new ReportParameter();
    cityList.Name = "Param3Name";
    cityList.Values.Add("AValue");
    // Set the report parameters for the report
    ReportViewer1.ServerReport.SetParameters(
    new ReportParameter[] { param1Name,Param2Name,Param3Name });

    }//if

    ============== ReportServerNetworkCredentials class created this way to pass in report server credentials ==================

    [Serializable]
    public sealed class ReportServerNetworkCredentials : IReportServerCredentials
    {
    #region IReportServerCredentials Members
    private string username, password;
    public ReportServerNetworkCredentials(string username, string password)
    {
    this.username = username;
    this.password = password;
    }
    public bool GetFormsCredentials(out System.Net.Cookie authCookie, out string userName, out string password, out string authority)
    {
    //throw new NotImplementedException();
    userName = password = authority = null;
    // The cookie name is specified in the <forms> element in Web.config (.ASPXAUTH by default)
    HttpCookie cookie = HttpContext.Current.Request.Cookies[".ASPXAUTH"];
    if (cookie == null)
    {
    authCookie = null;
    return false;
    }
    Cookie netCookie = new Cookie(cookie.Name, cookie.Value);
    if (cookie.Domain == null)
    {
    netCookie.Domain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"].ToUpper();
    }
    netCookie.Expires = cookie.Expires;
    netCookie.Path = cookie.Path;
    netCookie.Secure = cookie.Secure;
    authCookie = netCookie;
    return true;
    }
    public WindowsIdentity ImpersonationUser
    {
    get
    {
    return null;
    }
    }
    public System.Net.ICredentials NetworkCredentials
    {
    get
    {
    return new System.Net.NetworkCredential(this.username, this.password);
    }
    }
    WindowsIdentity IReportServerCredentials.ImpersonationUser
    {
    get
    {
    return null;
    }
    }
    }//class

    And when I run it, the following error message appears:

    • The request failed with HTTP status 403: Forbidden.
    Any ideas?
     

Share This Page