47

I have create a report using visual studio 2015 with SSDT Tools installed from the following link

https://msdn.microsoft.com/en-us/mt186501

The database is on SQL Server 2014. The reports work on my machine however when I try to upload a report on customers machine(Which has SQL Server 2014 and not visual studio). I get the following 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. (rsInvalidReportDefinition)"

Abe
  • 1,879
  • 2
  • 24
  • 39
  • Possible duplicate of [The report definition has an invalid target namespace rsInvalidReportDefinition](https://stackoverflow.com/questions/36272514/the-report-definition-has-an-invalid-target-namespace-rsinvalidreportdefinition) – Ashi Nov 17 '18 at 11:51

8 Answers8

89

If you have the solution > properties > TargetServerVersion set to SQL Server 2008 R2, 2012 or 2014 and then upload the RDL from the bin folder instead of the project folder, it should work. I was getting the same error and that solved it.

Andrew Failor
  • 916
  • 7
  • 5
  • 18
    Looking in the bin folder instead of the project folder was the useful bit here – Mark Peters Jul 15 '16 at 16:59
  • I picked the file from the bin folder and viola... I mean la voilà! – Heckflosse_230 Aug 16 '16 at 06:25
  • 1
    Yes thanks for your answer and this was the issue. Changing the target version fixes the error. Please note, when copying the files to upload copy it from \bin\debug instead of the project folder. – Abe Oct 14 '16 at 09:27
  • When we comparing rdl bin version with normal version (from root folder) will have lot of difference. Because bin version is compressed. Is there any way to deploy the rdl file from root folder ? – Sajith A.K. Dec 09 '16 at 12:16
  • 4
    Build / Rebuild the project for report edits to be reflected in the \bin\debug folder .rdl file – Lew Apr 13 '17 at 13:52
  • @Lew Clean and Rebuild the project (not the solution) fixed my problem and enable Visual Studio to successfully deploy the report. – Zarepheth Aug 01 '17 at 17:07
  • 5
    where is TargetServerVersion in visual studio 2017? –  Nov 22 '17 at 16:53
  • 4
    I have the same issue and can't find the solution > properties > TargetServerVersion in VS 2017. – Bonomi Jul 23 '18 at 09:10
  • 2
    Even it seemed to work for me in the past today I hit the same problem again. So what helped me this time was to go to report `Preview` which made all reports to be rebuilt. **Simple *Rebuild solution* did not help...** – Gabrielius Sep 11 '18 at 18:26
5

Your report is targeting SQL server 2016

Ed Elliott
  • 6,666
  • 17
  • 32
  • It works on my local machine. I do not have sql 2016 installed. I only have sql 2014. When I say it works I mean, I can run it from visual studio 2015. – Abe Mar 11 '16 at 09:04
  • hey Abe - go to the properties of the project (in solution explorer right click the project and choose properties) - then change "TargetServerVersion" at the bottom to "SQL Server 2008 R2, 2012 or 2014" - it defaults to 2016 (which hasn't been released yet) – Ed Elliott Mar 11 '16 at 14:16
  • Thats it. Thank you. It is fixed now. – Abe Mar 11 '16 at 15:52
  • 3
    I've set the TargetServerVersion to SQL Server 2008 R2, 2012 or 2014 however whenever I save in Visual Studio, it rewrites the report to use the 2016 namespace! – timk Apr 15 '16 at 01:56
  • Ouch! Raise a bug on connect and maybe point to it on the main ssdt forum – Ed Elliott Apr 15 '16 at 11:14
  • 2
    @timk, this is by design. See https://connect.microsoft.com/SQLServer/Feedback/Details/2103422 – Rami A. Apr 27 '16 at 01:01
  • 2
    After jou set the target version and build the project you can upload the rdl files in the output folder (default bin/debug). The original source rdl files wont upload, only the builded rdl files. – pexxxy Jun 08 '16 at 09:07
  • Yes thanks for your answer and this was the issue. Changing the target version fixes the error. Please note, when copying the files to upload copy it from \bin\debug instead of the project folder. – Abe Oct 14 '16 at 09:28
5

That one worked for me: getting SSRS version 2016 error, need to edit rdlc report. For detailed step visit this link: http://eskonr.com/2018/06/configmgr-ssrs-failed-to-upload-rdl-with-error-code-definition-of-this-report-is-not-valid-or-supported-by-this-version-of-reporting-services/

Changes:

  1. Search 2016, change the version from 2016 to 2010 .
  2. Search for "ReportParametersLayout" in file and remove the whole block (This code is created on 2016 version of visual studio).

As shown above, remove the whole block and save the report.

sanyassh
  • 8,100
  • 13
  • 36
  • 70
Khushboo Tahir
  • 627
  • 9
  • 9
3

If you are used Visual studio 2017

Update: Microsoft released a document on April-18, 2017 describing how to configure and use the reporting tool in Visual Studio 2017.

Visual Studio 2017 does not have the ReportViewer tool installed by default in the ToolBox. Installing the extension Microsoft Rdlc Report Designer for Visual Studio and then adding that to the ToolBox results in a non-visual component that appears below the form.

Microsoft Support had told me this is a bug, but as of April 21, 2017 it is "working as designed".

The following steps need to be followed for each project that requires ReportViewer.

If you have ReportViewer in the Toolbox, remove it. Highlight, right-click and delete. You will have to have a project with a form open to do this. If you have the Microsoft Rdlc Report Designer for Visual Studio extension installed, uninstall it. Close your solution and restart Visual Studio. This is a crucial step, errors will occur if VS is not restarted when switching between solutions. Open your solution. Open the NuGet Package Manager Console (Tools/NuGet Package Manager/Package Manager Console) At the PM> prompt enter this command, case matters.

Install-Package Microsoft.ReportingServices.ReportViewerControl.WinForms

You should see text describing the installation of the package.

I hope its working

  • Thanks for this, Worked for me. Followed the steps and added SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin")); to the Global.asax – kas_miyulu Dec 07 '18 at 12:46
1

Although the question is answered but this solution might help for the new visits.

In Visual Studio, go to tools -> Extensions and updates -> updates -> Update Reporting services.

After you close Visual Studio, it installs an VSiX installer .

The problem was solved for me. Hope this helps.

Dot Net developer
  • 436
  • 1
  • 5
  • 19
0

I got the answer from link "https://www.sqlskills.com/blogs/tim/issue-publishing-to-ssrs-2012-with-ssdt-2015/"

Issue publishing to SSRS 2012 with SSDT 2015 By: Tim Radney Posted on: January 22, 2016 2:58 pm I recently was helping a client who was trying to use SQL Server Data Tools 2015 to update and generate reports that would be deployed to SQL Server Reporting Services 2012. When trying to deploy the report, the client would get the following error:

“[rsInvalidReportDefinition] 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.”

I knew that SSDT 2015 should be backwards compatible and able to work with multiple versions of SQL Server products, so I had to do a little research to figure out what exactly needed to be changed in order to publish a report to SSRS 2012.

In my lab, I created a new project named GetDatabases. This project was a basic report that would get query a system table. The first thing I tried to change in the project was the TargetServerVersion located under the project properties.

I updated the TargetServerVersion to “SQL Server 2008 R2, 2012, or 2014”, the default in was “SQL Server 2016”. I also updated the TargetServerURL to my development server running SSRS 2012. I made these changes to both the release and debug configuration options.

After making these changes, I was still unable to deploy the report. After a bit more research, I found a location to change the default deployment server version of the Business Intelligence Designer. This is located under ‘Tools and then Options’. The default was set to version 13.0, once I changed the version to 11.0 to match the server I was deploying to, I was able to successfully deploy my report to SSRS 2012.

enter image description here

  • I have recently come across this issue as well. Although you change the target version if deploying on a server it is failing. The way I edited is Open the RDL file in choice of editor (I used Notepad++). Change the XML Header to 2010 from 2015. Delete Report Parameter Layout Section and Grid Layout section. After deleting open the file in the editor once again and check its gone. Save the file after changes and try upload the RDL file. Hope this helps. – Abe Apr 05 '17 at 09:02
0

I right clicked on my report and then clicked publish report1.rdlc which worked for me.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Waqas Javaid
  • 155
  • 1
  • 10
0

None of the proposed solutions worked for me, while I correctly have set the TargetServerVersion in the project properties. Note that I don't think that manually editing the .rdl file is a solution that is sustainable.

I do have a strange solution: In the IDE (Visual Studio 2019 in my case) change the Solution Configuration from Debug to DebugLocal. Now change the TargetServerVersion to any version you'd like, rebuild the report project and inspect the .rdl file, with any text editor, in the bin\DebugLocal folder.

You'll notice now that the namespaces DO react on every change to TargetServerVersion + rebuild.

Note: this only seems to work when the Solution Configuration has been set to DebugLocal, not for Debug or Release!!

Michel van Engelen
  • 2,791
  • 2
  • 29
  • 45