如何正确安装 和使用Microsoft.ReportViewer.WinForms.dll 里的控件 reportviewer?

0
我这里有一个项目,可以使用 第三方.net 控件,我感觉SSRS做报表很方便,准备用Reportviewer展现报表。我加载了Microsoft.ReportViewer.WinForms.dll 和Microsoft.ReportViewer.Common.dll, reportviewer 控件打开错误,不知道该怎么办?

错误提示:
Failed to create control System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.IO.FileNotFoundException: 未能加载文件或程序集“Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。
文件名:“Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”
在 Microsoft.Reporting.WinForms.LocalReport..ctor()
在 Microsoft.Reporting.WinForms.ReportViewer.Reset()
在 Microsoft.Reporting.WinForms.ReportViewer..ctor()

警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 。

--- 内部异常堆栈跟踪的结尾 ---
在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
在 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
在 ArchestrA.Visualization.GraphicLibrary.aaEmbeddedClientControl.CreateControl()
在 ArchestrA.Visualization.GraphicLibrary.CommonControls.aaControlBase.InitControlInternal(Boolean createhost)
已邀请:
0

梁勇 - 天道酬勤、上善若水。爱好商业智能 2014-02-25 回答

装完VS后,自带的就有这些控件和DLL文件了。
0

feng4887 - 70后IT菜鸟 2014-02-25 回答

经过朋友帮忙搞定了,需要加载那几个控件,然后在微软官网下载reportviewer.exe再安装一下就OK了。
ddd.jpg
0

feng4887 - 70后IT菜鸟 2014-02-25 回答

在部署的时候,需要那些控件,还需要再安装下reportviewer.exe;

PS:梁兄的方法没问题,只不过我觉得这么做有点杀鸡用牛刀了 :)
0

梁勇 - 天道酬勤、上善若水。爱好商业智能 2014-02-25 回答

@feng4887 不需要安装的,其实在工具栏里面有个reportview控件,直接拖过来就可以了
0

feng4887 - 70后IT菜鸟 2014-02-27 回答

ReportViewerLP(Microsoft Report Viewer Redistributable 2010 SP1

微软官方的描述:Microsoft Report Viewer 2010 SP1 Redistributable Package 包含用于查看使用 Microsoft 报告技术设计的报告的控件。

要回复问题请先登录注册