报表查看器控件未显示来自SSRS的报表
我正在VS 2013中使用MS Report Viewer 10;该项目是从VS 2010升级的.我解决了与Report Viewer相关的一系列问题,并启动并运行了控件.我在SSRS中有很多报告,并且我已经确认报告本身可以正常工作.
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.
我有一个Web Forms ASPX页面用于数据输入.它将数据通过JSON传递到一个包含Report Viewer控件的ASPX弹出页面.
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.
我正在运行IIS Express 7,SQL Server 2008 R2(v10.50)和当前的.NET Framework 4.5目标框架.
I am running IIS Express 7, SQL Server 2008 R2 (v10.50), and a current target framework of .NET Framework 4.5.
Report Viewer不返回任何报告-没有错误消息,没有丢失数据的报告布局,当然也没有完整的报告.当我通过VS使用相同的输入运行相同的报告时,报告预览会显示我期望的结果.
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
设置为 Remote
,并且 ReportServerCredentials
设置为 null
.我研究了这意味着什么,这意味着Report Viewer应该使用当前网络凭据(即当前用户)连接到SSRS.我确认当前用户与我当前的登录名正确匹配;我可以使用Windows身份验证正确连接到SSRS和SQL Server.
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不在Web表单设计器中创建,因此我无法在设计时在其上设置任何属性.
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.
页面上的控制代码:
<ssrs:ReportViewer ID="ReportViewer" runat="server" ProcessingMode="Remote" Width="100%"
Height="690" ShowParameterPrompts="false" AsyncRendering="false"/>
在我尝试运行报告后,SSRS日志包含以下条目:
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=''
旧项目使用MS Report Viewer9.它运行得很好.我在 web.config
中看到的唯一更改与更高版本以及从IIS 6到IIS 7的更改有关.
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.
自从出现评论以来,这是来自web.config的相关行:
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:
ETA 11月24日:我最终在应用程序日志中得到一个条目: HttpHandlerInputException,缺少URL参数:IterationId
.此问题已在另一个STOF问题与解答中进行了讨论.
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.
按照@CodeswithHammer的要求,我将此引用添加到另一个线程中,只是为了节省人们寻找它的时间.
As requested by @CodeswithHammer I'm adding this reference to another thread for just to save people some time searching for it.