14

I have an AspNet MVC project in Visual Studio 2017 that was previously developed in Visual Studio 2015. This project contains many rdlc files that were working fine until I edited one of them. Now, when I try to download the pdf from the rdlc edited I get this error:

The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' which cannot be upgraded.

The rdlc edited changes its namespace from http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition to http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition

The project is running with net framework 4.6.2 and it has installed Microsoft.ReportViewer.Runtime.Common.12.0.2402.15 and Microsoft.ReportViewer.Runtime.WebForms.12.0.2402.15 nuget packages

Fidel Garcia
  • 405
  • 1
  • 6
  • 16

3 Answers3

37

I had the same problem and I solved it uninstalling the nuget packages Microsoft.ReportViewer.Runtime.Common and Microsoft.ReportViewer.Runtime.WebForms and installing the package Microsoft.ReportingServices.ReportViewerControl.WebForms.140.340.80. I would like to highlight that I had to add a reference to System.Windows.Forms because there is a dependency in the class ReportDataSource that I use to render my reports

  • 2
    https://www.nuget.org/packages/Microsoft.ReportingServices.ReportViewerControl.WebForms/ Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms -Version 140.802.134 – Roberto Hernandez Sep 01 '17 at 20:21
  • 6
    Fidel Thank you for asking this question clear and thank you so much Lilliam for answer. It was 3 days i was looking for a solution for this. For those who are looking solution for WPF application you need to install this package: **Microsoft.ReportingServices.ReportViewerControl.Winforms.140.340.80** – Ali Sep 20 '17 at 17:26
  • I'm having the same problem in a WebApi 2.0... The scenario is different, I'm not using Microsoft.ReportViewer.Runtime.WebForms, I'm using only Microsoft.ReportViewer.Runtime.Common... – DarioN1 Jun 04 '18 at 08:57
  • This solution works, also do make sure the property "Build Action" of your RDLC-report is set to "Content", in my case was set to "Embedded Resource" and it was generating an error when I published to a production server. If your RDLC-report uses .resx files also verify they exist in their respective folder. – Wilson Jun 12 '19 at 16:56
  • another thing should be considered , install nuget package for "Microsoft.SqlServer.Types" version 14 , Of course our project is dotnet and our db is microsoft sql server – keivan kashani Nov 17 '20 at 10:41
  • Cannot find version 140, only 150. Still get following error trying to upgrade from SSRS 2005 to 2016: "The base class includes the field 'ReportViewer', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer)." – ARLibertarian May 04 '22 at 19:48
0

I have answered this where this error occurs for users upgrading to Visual Studio 2019 here; https://stackoverflow.com/a/72790325/1165173

nimblebit
  • 473
  • 3
  • 11
  • 22
-2

I right clicked the rdlc file in the solution explorer and selected replace from server and it fixed the problem for me. I think vs 2017 tries to update the schema to use a different version of sql server and getting the original report definition fixes it. Maybe, I don't know, but it worked for me.

  • It changed the schema back to this, from something like this for me. – Kevin G Brooks Jul 14 '17 at 15:01
  • I'm not sure what your answer is about. Could you explain more? – Fidel Garcia Jul 14 '17 at 19:41
  • This answer neither identifies the problem or provides a permanent solution - clearly the person asking the question needs to be able to edit the RDLC file, not just pull it from the server. – Ben Mar 21 '18 at 14:25