将 .rdlc 部署到服务器时出现问题。 (即带有本地报告的 ReportViewer)
我想发布我的 Web 应用程序并使用 Microsoft ReportViewer 查看报告。一切都在本地运行,但在发布时我遇到了许多令人不安的错误。最后我似乎遇到了一个我无法修复的问题。
到目前为止,我已经解决了前 3 个问题...
- 安装 Miscrosoft Report 查看器可再发行 2008
包在我的服务器上。 - 将我的“rdlc”文件更改为“内容”并删除了 rdlc web.config 中的 buildProvider 文件。
- 在 IIS 中为 ReportViewer 配置托管处理程序
最后,ReportViewer 至少是可见的,并且它“似乎”正在尝试加载报表。但现在我收到以下错误:
[InvalidCastException:无法转换 类型的对象 'Microsoft.Reporting.WebForms.ReportHierarchy' 键入 'Microsoft.Reporting.WebForms.ReportHierarchy'。] Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +253 Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +669 Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext 上下文)+13
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔值&同步完成) +75
哦,太棒了!当然,您不能将对象强制转换为它已经存在的类型!!!!有人知道如何解决这个问题吗?
谢谢,
贾斯汀
I would like to Publish my web application and view a report with the Microsoft ReportViewer. Everything works locally but when published I've encountered a troubling number of errors. Finally I seem to have come across one that I cannot fix.
So far I have solved the first 3 problems by...
- Installing the Miscrosoft Report
Viewer Redistributable 2008
package on my server. - Changed my "rdlc" file to be "Content" and removed the rdlc
buildProvider in the web.config
file. - Configured the Managed Handler in IIS for the ReportViewer
Finally, the ReportViewer is at least visible and it "seems" to be trying to load the report. BUT Now I'm getting the following error:
[InvalidCastException: Unable to cast
object of type
'Microsoft.Reporting.WebForms.ReportHierarchy'
to type
'Microsoft.Reporting.WebForms.ReportHierarchy'.]
Microsoft.Reporting.WebForms.ReportDataOperation..ctor()
+253 Microsoft.Reporting.WebForms.HttpHandler.GetHandler()
+669 Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
context) +13
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+181 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)
+75
Oh great! Of course you can't cast an object to the type that it already is!!!! Does anybody know how to fix this one?
Thanks,
Justin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实证明,当我执行步骤 3 时。
“在 IIS 中为 ReportViewer 配置托管处理程序”
我注册了错误的处理程序。该系统有 v8.0 和 v9.0。选错的概率是 50-50,我赢了。
让这成为那些认为对话框不需要调整大小的人的一个教训......他们总是应该这样你才能看到内容。版本号在下拉列表中不可见,您眼前看到的是 2 个相同的条目!
无论如何...如果您遇到此问题,请检查 Visual Studio 中的版本是否与报表服务器计算机上的托管处理程序相匹配。
Well turns out when I did step 3.
"Configured the Managed Handler in IIS for the ReportViewer"
I registered the wrong one. The system had a v8.0 and a v9.0. 50-50 odds of picking the wrong one and I won.
Let this be a lesson to people who think dialog boxes don't need to be resizable... THEY ALWAYS SHOULD so you can see the content. The version number is not visible in the dropdown you are staring at 2 identical entries to the eye!!!
Anyways... if you encounter this problem check that you're version in Visual Studio matches your Managed Handler on the report server machine.
如果您没有将 Visual Studio 升级到 SP1,则需要按照 此 MSDN 线程。
If you don't have Visual Studio upgraded to SP1, you need to upgrade as per this MSDN thread.
您的服务器上安装了.Net 3.5 SP1吗?
Do you have .Net 3.5 SP1 installed on the server?