开发者

ASP.NET ReportViewer works in development, is empty when deployed

开发者 https://www.devze.com 2023-01-18 06:51 出处:网络
I have a ASP.NET web app that utilizes ReportViewer to show local reports. Everything works beautifully on my development machine (XP Pro, Visual Studio 2008). When I deploy the app to the production

I have a ASP.NET web app that utilizes ReportViewer to show local reports. Everything works beautifully on my development machine (XP Pro, Visual Studio 2008). When I deploy the app to the production server (Windows Server 2008, IIS 7), the site works very well, except for the report viewer. When I generate the report, the report viewer remains empty.

开发者_如何学GoI have written debugging code to verify that the records are being received from the database, and they are. No error occurs but, no records are show in the report viewer. Also, the images that normally appear in the menu bar of the ReportViewer control (export button, print button, forward and back buttons, etc) do not load either.

I ran the ReportViewer.exe on the server to install the appropriate files, and I have verified that they are in the GAC of the machine.

Can anyone suggest a way to debug this...it would be easier if an error was being generated (I can't believe I just said that)?


Please verify that you have the required web.config entries. My suspicion is that you are missing the entry in system.webServer/handlers, which is required in IIS7. IIS7 pretty much ignores the system.web/httpHandlers section, which may explain why it works in IIS 5.1 (XP) but not in 7.

Version numbers may vary, but this should cover it for entries:

In the system.web/compilation section:

  <buildProviders>
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </buildProviders>

In the system.web/httpHandlers section

  <add path="Reserved.ReportViewerWebControl.axd"
       verb="*"
       type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
       validate="false" />

And in the system.webServer/handlers section:

  <add name="ReportViewer"
       path="Reserved.ReportViewerWebControl.axd"
       verb="*"
       type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
       preCondition="integratedMode" />
0

精彩评论

暂无评论...
验证码 换一张
取 消