4
votes

I'm using MS Report Viewer 10 in VS 2013; the project is being upgraded from VS 2010. I have worked through a series of issues relating to Report Viewer, and have the control itself up and running. I have a number of reports in SSRS, and I have confirmed that the reports themselves work properly.

I have a Web Forms ASPX page for data input. It passes data via JSON to a popup ASPX page that contains the Report Viewer control.

I am running IIS Express 7, SQL Server 2008 R2 (v10.50), and a current target framework of .NET Framework 4.5.

Report Viewer does not return any report -- no error message, no report layout missing data, and certainly no complete report. When I run the same report with the same inputs through VS, the report preview shows the results I expect.

ProcessingMode is set to Remote and ReportServerCredentials is null. I researched what this means, and it means that Report Viewer should connect to SSRS with the current network credentials, namely the current user. I confirmed that the current user correctly matches my current login; I can connect to SSRS and SQL Server using Windows authentication properly.

ReportViewer doesn't create in the web form designer, so I can't set any properties on it at design time.

So I suspect my issue is a matter of authentication at run time. I am out of ideas on how to investiagte and resolve this.

The control code on the page:

    <ssrs:ReportViewer ID="ReportViewer" runat="server" ProcessingMode="Remote" Width="100%"
        Height="690" ShowParameterPrompts="false" AsyncRendering="false"/>

The SSRS log contains the following entries after I attempt to run the report:

library!ReportServer_0-3!1dc8!(datetime): i INFO: RenderForNewSession('(report)')
webserver!ReportServer_0-3!1dc8!(datetime, 1 second later): i INFO: Processed report. Report='(report)', Stream=''

The legacy project used MS Report Viewer 9. It ran just fine. The only changes I see in web.config relate to the later version and a change from IIS 6 to IIS 7.

Since it came up in comments, here's the relevant line from web.config:

<system.webServer>
  <handlers>
    <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"/>
  </handlers>
</system.webServer>

My Report Viewer window: Report Viewer blank window


ETA 24 Nov: I eventually got an entry in the application log: HttpHandlerInputException, Missing URL parameter: IterationId. This issue has been discussed at another STOF Q&A.

3
does your report show the header (where the filters and Show Report button appears)?JCM
@JorgeCalvoMorales: Report Viewer's header does appear -- the bar with the page selection (showing page 1 of 2, which is correct), Find|Next, save, and refresh. All controls on the header are disabled.Codes with Hammer
Can you please inspect the area below of report's header? Check if there's a hidden error message like: The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file -or- Could not load type 'Reserved.ReportViewerWebControl.axd'JCM
When I view the HTML source, I see the "has not been registered" error message in a <div> element with an ID of ReportViewer_HttpHandlerMissingErrorMessage. In fact, I saw that yesterday, and confirmed that the requested line already exists in the system.webserver/handlers node of web.config -- character for character, in fact, with the same order of fields.Codes with Hammer
OK, let's check IIS. Are you under Default Web Site node? If so, please check if there's that handler mapping already, in that case your application must inherit that handler. Now, if you are on a different web site, please make sure your Path's file handler is File or Folder. Also check its Request Restrictions, Access tab must have Script option selected.JCM

3 Answers

1
votes

As requested by @CodeswithHammer I'm adding this reference to another thread for just to save people some time searching for it.

https://stackoverflow.com/a/22000827/1807669

0
votes

Below is code snippet using which i am using to bind ReportViewer with SSRS report

ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials("ReportServerUsername", "ReportServerPassword", "");
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://mymachinename//ReportServer");
ReportViewer1.ServerReport.ReportPath = "/MyReports/TestReport1";

Here ReportServerUrl is path of SQL Report Server(SSRS) configured in my machine and in ReportPath "MyReports" is folder in SQL Report Server in which i have Report named TestReport1

0
votes

When you update version of the SSRS control in your app and web.config you also need to add a new handler for it in IIS. If you had one in your mappings previously remove it and add a new one.

  1. Open IIS manager and select your application Under IIS section
  2. Double click on Handler Mappings icon On the Action pane on your
  3. Right click Add Managed Handler
  4. When the dialog opens enter the following:

    Request path: Reserved.ReportViewerWebControl.axd

    Type: Microsoft.Reporting.WebForms.HttpHandler

    Name: Reserved-ReportViewerWebControl-axd

  5. Cick OK

Also makesure your server, credentials and path to your report are correct.

var serverReport = this.ReportViewer1.ServerReport;
serverReport.ReportServerCredentials = new ReportServerCredentials(userName, password, "yourDomain.com");
serverReport.ReportServerUrl = new Uri("your report server");
serverReport.ReportPath = "yourReportName";
serverReport.Refresh();

And in your aspx:

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