Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft'

I simply get the following error:

The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

after adding this to my code:

protected global::Microsoft.Reporting.WebForms.ReportViewer ReportViewer1; 

I've seen some solutions saying I must add some assemblies. but none of them worked. here is an example:

<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 

can anyone help me with this?

like image 385
dieKoderin Avatar asked Nov 08 '14 06:11

dieKoderin


2 Answers

In my case I needed to actually install Microsoft Report Viewer on the troublesome machine.

  • Report Viewer 2010 (version=10)
  • Report Viewer 2012 (version=11)
  • Report Viewer 2015

Of course, other ones are available, it can be worked out which from the Version= on the dll which one is needed. In my case I needed version 11 (the 2012 one).

like image 116
NikolaiDante Avatar answered Oct 08 '22 03:10

NikolaiDante


I did it by right-clicking on References folder in my project and then selecting Add Reference. and then adding Assemblies > Extensions > Microsoft.ReportViewer to the references.

like image 38
dieKoderin Avatar answered Oct 08 '22 03:10

dieKoderin