Microsoft Report查看器程序集引用 [英] Microsoft Report viewer assembly referencing

查看:48
本文介绍了Microsoft Report查看器程序集引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要在本地模式下使用Microsoft Report Viewer生成报告。我使用了MS Report Viewer 2005,即通过引用Microsoft.ReportViewer.WinForms.dll和Microsoft.ReportViewer.Common.dll以及8.0.0.0版本。如果我的计算机中安装了Microsoft Report viewer 2005,则报告生成正常,但如果安装了Microsoft Report viewer 2010,则不会生成报告。



所以我有任何方式可以参考一个装配版本,报告适用于所有更高版本。



或者有什么方法我可以引用相同的程序集名称但不同的版本。



或者哪种方法可以解决这个问题。

There was requirement for generating reports using Microsoft Report Viewer in local mode. I have used MS Report Viewer 2005 i.e. by referencing Microsoft.ReportViewer.WinForms.dll and Microsoft.ReportViewer.Common.dll with 8.0.0.0 version. The reports are getting generated fine if there is Microsoft Report viewer 2005 installed in my machine, but doesn't generate if Microsoft Report viewer 2010 is installed.

So is there any way that I ll reference to one assembly version and reports will work for all its higher versions.

Or is there any way where i can reference the same assembly name but different version.

Or which is the best way to solve this problem.

推荐答案

你用的是什么语言?什么版本的Visual Studio?



我在我的C#项目中引用Microsoft.ReportViewer.WinForms.dll。



你得到什么错误信息以及什么时候?
What language are you using? What version of Visual Studio?

I am referencing Microsoft.ReportViewer.WinForms.dll in my C# project.

What error message do you get and when?


你使用什么语言?

我正在使用C#

< br $>
什么版本的Visual Studio?

Visual Studio 2010

我正在使用.Net framework 3.5。



你得到什么错误信息以及什么时候?

我想以这种方式表达,

我使用了MS Report Viewer 2005即引用Microsoft.ReportViewer.WinForms.dll和Microsoft.ReportViewer.Common.dll与8.0.0.0版本。这里我没有引用10.0.0.0版本。



现在将它部署到安装了该机器Microsoft Report viewer 2005的机器中。我的报告工作正常。



现在假设我的机器中没有Microsoft Report viewer 2005而是安装了Microsoft Report viewer 2010。这时我收到错误

错误:无法加载文件或程序集'Microsoft.ReportViewer.WebForms,Version = 10.0.0.0。 ......



所以我想知道我是否可以这样做

所以我有什么方法可以参考一个程序集版本(对于Microsoft.ReportViewer.WinForms.dll和Microsoft.ReportViewer.Common.dll与8.0.0.0版本。这将仅在我安装Microsoft Report viewer 2005时有效)并且报告将适用于其所有更高版本(如即使我安装Microsoft Report viewer 2008,2010)。
What language are you using?
I am using C#

What version of Visual Studio?
Visual Studio 2010
I am using .Net framework 3.5.

What error message do you get and when?
I would like to put it in this way,
I have used MS Report Viewer 2005 i.e. by referencing Microsoft.ReportViewer.WinForms.dll and Microsoft.ReportViewer.Common.dll with 8.0.0.0 version. Here i am not referencing to 10.0.0.0 version.

Now after deploying it in a machine where in that machine "Microsoft Report viewer 2005" installed. My reports works fine.

Now suppose in my machine if there is no "Microsoft Report viewer 2005" instead it has "Microsoft Report viewer 2010" installed. At this time i am getting error as
Error : Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0. ......

So i wanted to know whether i can do this
So is there any way that I will reference to one assembly version(for ex Microsoft.ReportViewer.WinForms.dll and Microsoft.ReportViewer.Common.dll with 8.0.0.0 version. This will work only when i install Microsoft Report viewer 2005) and reports will work for all its higher versions(like Even if i install Microsoft Report viewer 2008, 2010).


这篇关于Microsoft Report查看器程序集引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆