title: ReportViewer control not displaying reports
body: <p>I have looked just about everywhere for a solution to this issue and have not found one that has worked for me yet. I have a reporting server (2008 R2) set up on our hosting server. I have created a report from scratch using the report builder, tested it out while logging into the report server with its URL and it successfully generates reports. </p>
  
  <p>When I try to view the report from our MVC application, only the reports toolbar renders (showing export, print, pages, and the view report button). It shows that it is "Loading", and after it completes it's just a blank report, but it shows the correct parameters on the toolbar, and if I change the name of the parameters in the code it returns an error stating the parameter doesn't exist; so I know the address user/pw information is correct.</p>
  
  <p><strong>Code and markup for the page</strong> </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %&gt;
  &lt;%@ Import Namespace="Comp.Proj.Core.Model"%&gt;
  &lt;%@ Import Namespace="Comp.Proj.Core.Service" %&gt;
  &lt;%@ Import Namespace="Microsoft.Reporting.WebForms" %&gt;
  &lt;%@ Import Namespace="System.Security.Principal" %&gt;
  &lt;%@ Import Namespace="System.Net" %&gt;
  &lt;%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
      Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %&gt;
  
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
    &lt;h2&gt;&lt;a href="/Reporting"&gt;Back to Reports&lt;/a&gt; / &lt;%=ViewData["Report"]%&gt;&lt;/h2&gt;
      &lt;form action="/Reporting/DateViewer" method="get"&gt;
        Start Date:
        &lt;input type="text" name="start" class="datepicker" value="&lt;%=ViewData[" Start "] %&gt;" /&gt; End Date:
        &lt;input type="text" name="end" class="datepicker" value="&lt;%=ViewData[" End "] %&gt;" /&gt;
        &lt;input type="hidden" name="id" value="&lt;%=ViewData[" Report "] %&gt;" /&gt;
        &lt;input type="submit" class="button" value="Run" /&gt;
      &lt;/form&gt;
  
      &lt;script runat="server" language="C#"&gt;
        protected void Page_Load(object sender, EventArgs e) {
          try {
            if (!IsPostBack) {
              if (ViewData["Start"] != null) {
                var param = new List &lt; ReportParameter &gt; ();
  
  
                var start = new ReportParameter("start", ViewData["Start"].ToString());
                var end = new ReportParameter("end", ViewData["End"].ToString());
                var region = new ReportParameter("region", "2");
                param.Add(start);
                param.Add(end);
                param.Add(region);
                ReportViewer1.Width = 1100;
                ReportViewer1.Height = 900;
                ReportViewer1.ShowCredentialPrompts = false;
                ReportViewer1.ShowDocumentMapButton = false;
                ReportViewer1.ShowExportControls = true;
                ReportViewer1.ShowFindControls = false;
                ReportViewer1.ShowPrintButton = true;
                ReportViewer1.ShowPromptAreaButton = false;
                ReportViewer1.ShowRefreshButton = false;
                ReportViewer1.ShowToolBar = true;
                ReportViewer1.ShowZoomControl = false;
                ReportViewer1.SizeToReportContent = true;
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                IReportServerCredentials irsc =
                  new CustomReportCredentials(ConfigurationManager.AppSettings["ReportServerUser"],
                                              ConfigurationManager.AppSettings["ReportServerPassword"], "SERVERNAME");
                ReportViewer1.ServerReport.ReportServerCredentials = irsc;
                ReportViewer1.ServerReport.ReportServerUrl =
                  new Uri(string.Format("http://{0}/ReportServer",
                                        ConfigurationManager.AppSettings["ReportServerUrl"]));
                ReportViewer1.ServerReport.ReportPath = string.Format("/{0}", ViewData["Report"]);
                ReportViewer1.ServerReport.SetParameters(param);
                ReportViewer1.ShowReportBody = true;
                ReportViewer1.ServerReport.Refresh();
              }
            }
          } catch (Exception ex) {
            Response.Write(ex.Message);
          }
        }
      &lt;/script&gt;
  
      &lt;form id="form1" runat="server"&gt;
        &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
        &lt;div&gt;
          &lt;rsweb:ReportViewer ID="ReportViewer1" runat="server" /&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p><strong>Web config</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;assemblies&gt;
      &lt;add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
      &lt;add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
  &lt;/assemblies&gt;
  
  &lt;buildProviders&gt;
      &lt;add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;
  &lt;/buildProviders&gt;
  
  &lt;system.webServer&gt;
      &lt;handlers&gt;
          &lt;add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;
      &lt;/handlers&gt;
  &lt;/system.webServer&gt;
  </code></pre>