Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReportViewer Control Version Conflict

I am having a version problem with the ReportViewer Control. I am using visual studio 2010, but I think I need to use the 2005 report viewer because I am using SQL 2005. So, I set the webconfig file to point to the 2005 ReportViewer .dlls, everything works once, then VS edits the web.config to point to the 2010 versions of the dlls. Here is the relevant web config file sections set what I think is correctly:

<httpHandlers>
  <add path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" />
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    validate="false" />
</httpHandlers>

<compilation>
  <assemblies>
    <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
  </assemblies>
  <buildProviders>
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </buildProviders>
</compilation>

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
  <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" 
       type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>

So, after running it and it working a few times, it automatically changes the version of the http handler to 10.0.0.0. How can I prevent this?

like image 294
Ethan Schofer Avatar asked May 25 '26 16:05

Ethan Schofer


2 Answers

What is written to the web.config is defined by the references you use in the project.

In my Visual Studio 2008 project, I have the following references:

  • Microsoft.ReportViewer.Common.dll (Version 9.0.0.0)
  • Microsoft.ReportViewer.WebForms.dll (Version 9.0.0.0)

So in my config I see:

<system.web>
  ...
  <compilation>
    ...
    <buildProviders>
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />        
    </buildProviders>
  </compilation>
  ...
  <httpHandlers>
    <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
  </httpHandlers>

When I look at the available project references I have three:

  • Version 8.0.0.0
  • Version 9.0.0.0
  • Version 10.0.0.0

I assume this is because I have Visual Studio 2005, 2008, and 2010 installed, but perhaps installing the individual report viewer redistributables would offer the same selection:

  • MS Report Viewer 2005 (Version 8.0.0.0)
  • MS Report Viewer 2005 SP1 (Upgrade) (Version 8.0.50727.42)
  • MS Report Viewer 2005 SP1 (Full Install) (Version 8.0.50727.42)
  • MS Report Viewer 2008 (Version 9.0.0.0)
  • MS Report Viewer 2008 SP1 (Version 9.0.0.0)
  • MS Report Viewer 2010 (Version 10.0.0.0)

N.B. I've made best guesses at the version numbers; if you know better please correct me.

like image 61
Kevin Hogg Avatar answered May 28 '26 05:05

Kevin Hogg


It is not an exact answer to your question but probably the solution.
There is no need to use older version of report viewer. It is independent on the server. Especially with .rdlc (client reports) you provide only data and report does not know the server.

like image 35
IvanH Avatar answered May 28 '26 04:05

IvanH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!