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>
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.
答案 0 :(得分:1)
根据@CodeswithHammer的要求,我将此引用添加到另一个线程,以便为人们节省一些时间来搜索它。
答案 1 :(得分:0)
在应用程序和web.config中更新SSRS控件的版本时,还需要在IIS中为其添加新的处理程序。如果您的映射中有一个,请先将其删除并添加一个新的。
对话框打开后,输入以下内容:
请求路径:Reserved.ReportViewerWebControl.axd
类型:Microsoft.Reporting.WebForms.HttpHandler
名称:保留 - ReportViewerWebControl-axd
Cick OK
还可以确保您的服务器,凭据和报告路径正确无误。
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();
在你的aspx中:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
答案 2 :(得分:0)
以下是我用于将ReportViewer与SSRS报告
绑定的代码段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";
此处ReportServerUrl是在我的机器中配置的SQL报表服务器(SSRS)的路径,在ReportPath中,“MyReports”是SQL Report Server中的文件夹,其中我有一个名为TestReport1的报表