使用 rdlc 页面的 Asp.net Microsoft ReportViewer 永远不会加载
我已在 Web 服务器上安装了 Visual Studio 2008 sp1 Report Viewer Redistributable。我必须从微软下载它,因为我看到其他人发布的位置在我安装的 Visual Studio 中不存在。我下载了位于此处的一个: http://www.microsoft.com/downloads/details.aspx?familyid=BB196D5D-76C2-4A0E-9458-267D22B6AAC6&displaylang=en。
我认为人们所说的 ReportViewer.exe 所在的位置通常是:C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe。我有 Visual Studio Team Suite Development Edition 2008 并且 SDK 下的 v2.0 目录不存在。这可能是我的一些问题,但我不这么认为。
我说这一切是为了说我可以设计 Microsoft 报表,并且我可以在本地使用报表查看器运行该页面。它看起来确实非常有效,并且可以为公司带来很大帮助。
然而,当我部署到网络服务器时,托管reportviewer控件的页面总是会说“此页面没有预编译..”,或类似的内容。它通常不会说什么,只是坐在那里尝试加载。
同一网站中的其他页面不会出现这些症状。通过在网络服务器上安装可再发行组件,我还成功获得了水晶报告来显示其查看器。
I have installed the Visual Studio 2008 sp1 Report Viewer Redistributable on the web server. I had to download it from microsoft, because the location I've seen other people post does not exist on my install of visual studio. I downloaded the one that is located here: http://www.microsoft.com/downloads/details.aspx?familyid=BB196D5D-76C2-4A0E-9458-267D22B6AAC6&displaylang=en.
I think the location people say ReportViewer.exe is in, is usualy: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe. I have Visual Studio Team Suite Development Edition 2008 and the v2.0 directory under SDK does not exist. That may be some of my problem, I do not think so though.
I say all that to say that I can design the Microsoft Report, and I can run the page with the report viewer locally just fine. It seems to work really great, and could help out the company quite a bit.
However when I deploy to the webserver the page that host the reportviewer control will allways either say "This page does not have a precompiled..", or something like that. It usualy doesn't say anything and just sits there trying to load.
Other pages in the same website do not exhibit these symptoms. I have also successfully gotten crystal reports to display it's viewer, by installing the redistributable on the web server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们的网络服务器肯定出了问题。我终于加载了报告,并出现了一条错误消息,该消息与该论坛帖子讨论的内容相同 http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/b237dbab-7670-4c7a-b9af- 70c5be7101d9。
然后我可以选中允许预编译站点可更新的框。这解决了我的问题。我现在水晶和微软报告都可以正常工作。也许这篇文章会对其他人有所帮助。
编辑 2/18/2010 8:18am cst 我以为它已经修复了,但显然没有,一旦我再次发布到网络服务器,页面将不再加载。我将尝试在虚拟机中设置一个全新的服务器,以尝试进行更多测试。
编辑 2/19/2010 8:17am cst 昨天我花了很多时间设置一个全新的虚拟机,其中包含 server 2003、Visual Studio 2008 和 sql 2005。我运行了相同的报告页面,所有这些其上有报表查看器控件。它仍然无法加载。我认为您必须对 IIS 配置进行一些操作才能使其正常工作,因为它不会以默认设置加载。
编辑 2/19/2010 9:47am cst 我创建了一个新的 Web 应用程序,其中仅包含报告,即全新的 web.config 文件。我的 web.config 文件中的某些内容导致了问题。这个新的网络应用程序显然正在运行。我现在要尝试看看是否可以将任何新页面添加到以前的网络应用程序中。也许有什么原因导致所有新页面无法加载。
编辑 2010 年 2 月 19 日上午 10:12(中部标准时间) 奇怪的是,该报告有时会加载。这种情况在测试环境和生产环境中都会发生。我确实发现了一份给微软的有点有趣、愤怒的错误报告,它解释了 rdlc 文件编译的问题。这就是产生以下错误的原因:
**
**
错误报告网址:http://connect.microsoft.com/VisualStudio/feedback/details/468068/rdlc-files-are-build-into-resources-during-publish-this-is-a -标记文件
修复它的博客文章网址: http://weblogs.asp.net/stephensonger/archive/2008/09/10/deploying-rdlc-files-in-local-mode-for-asp-net-应用程序.aspx
正如您所知,您可能觉得这并不有趣,但有一个错误会导致 rdlc 文件因某种原因进行编译。您还可以通过让网站可更新来修复此问题,这是在 Visual Studio 中发布时可以选中的复选框之一。
编辑 2/19/2010 10:51am cst 我的下一步是对当前虚拟机进行快照,返回到我安装 sql 2005 的位置。此时我将安装 Visual Studio 2010 rc 并看看是否存在同样的问题。
编辑 3/3/2010 9:15am cst 我不知道是什么解决了这个问题,但水晶和微软报告现在已经正确显示了一段时间。除了我在这里提到的内容之外,我没有做任何更改。
There must be something going on with one of our web servers. I finally got the report to load and it came up with an error message that said the same thing that this forum post talks about http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/b237dbab-7670-4c7a-b9af-70c5be7101d9.
I was then able to check the box that says allow precompiled site to be updatable. That fixed my issue. I now have both crystal and microsoft reports working correctly. Maybe this post will help someone else.
edit 2/18/2010 8:18am cst I thought it was fixed apparently not, as soon as I published to the web server again, the page will not load anymore. I am going to try and setup a completely new server in a virtual machine, to try and do more testing.
edit 2/19/2010 8:17am cst I spent alot of yesterday setting up a brand new virtual machine with server 2003, visual studio 2008, and sql 2005. I ran the same report page, all it has on it is the report viewer control. It still will not load. I figure there is something you have to do with IIS configuration to get it to work, since it won't load with default settings.
edit 2/19/2010 9:47am cst I have created a new web application with only the report in it, brand new web.config file. Something about my web.config file is causing the problem. This new web application is apparently working. I am now going to try and see if any new pages can be added to the previous web app at all. Maybe something is causing all new pages to not load.
edit 2/19/2010 10:12am cst Bizarrely the report sometimes loads. This happens on both the test environment, and the production environment. I did find a somewhat funny angry bug report to microsoft that explains the problem with the rdlc files compiling. That is what produces the following error:
**
**
The Bug report url: http://connect.microsoft.com/VisualStudio/feedback/details/468068/rdlc-files-are-build-into-resources-during-publish-this-is-a-marker-file
The blog post url that fixes it: http://weblogs.asp.net/stephensonger/archive/2008/09/10/deploying-rdlc-files-in-local-mode-for-asp-net-applications.aspx
As you can tell, possibly you don't find it funny, but there is a bug that causes rdlc files to compile for some reason. You can also fix it by having your site be updatable, which is one of the check boxes you can check when you publish in visual studio.
edit 2/19/2010 10:51am cst My next step is to snapshot the current virtual machine, go back to the point I installed sql 2005. At that point I'll install visual studio 2010 rc and see if it exhibits the same problem.
edit 3/3/2010 9:15am cst I don't know what fixed it, but both crystal and microsoft reports have been displaying correctly for awhile now. I made no changes other than what I have mentioned here.