Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010: The report definition is not valid. Details: The report definition has an invalid target

Re: The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded.

Report expert needed, beam on over...

Here are the step I went through today to accomplish this bit of foolishness.

1) Visual Studio 2010, with SQL Server 2012

2) App is a winforms vb.net, has been working great, was originally developed in VS 2008

Reports ran fine this AM before I got to them. -sigh-

3) Tried to edit a few reports - first time since upgrading to SQL 2012.

4) Could not edit the datasets and decided something was corrupt.

5) Ran a repair installation on VS 2010 and ensured it was fully up-to-date. no joy - could not update dataset.

6) Re-ran install for SQL SSMS with addition of SDK for connectivity clients

7) Now I could edit the report datasets, but the reports are broken. (see title) -double sigh-

Report viewer is 10.0.0

.Net is 4.0

Thanks for any tips

Mac McCaskie

like image 626
Mac McCaskie Avatar asked Jun 21 '13 20:06

Mac McCaskie


2 Answers

I had this issue today in VS2013.

Be sure to reference the correct ReporViewer dll version:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\ReportViewer\

like image 181
Mário Meyrelles Avatar answered Sep 20 '22 07:09

Mário Meyrelles


I think the fix may be simpler than you anticipate if I remember correct. Your name space just needs to be changed to reference the newer service. You cannot run 2012 on a 2008 namespace to my knowledge. I am confused though as you mention 'Winforms' app which deals with INDIRECTLY talking to SQL reporting Services through a viewer set up generally in multiple ways. If that is the case follow below on A, but then you mention editing the reports directly so I am curious are these client reports directly in an application? If so I would assume if that is the case you are talking about SSRS 2012 with RDL reports and in which case I would try B if this is for report hosted reports created with the Business Intelligence Development Studio add on VS 2010 created from SQL 2012. If you are talking about client reports stored locally in a VB.NET application I could potentially guess that they may have been upgraded to 2012 which uses .NET 4.5 and you potentially are trying a lower framework but that is just a guess on the last one and would be highly unlikely since .NET carries previous versions with it and I would not think it would upgrade reports without telling you.

A:

You can re install 2012 forever but not get it to use 2008's namespace for data. You need to be using the most current proxy classes from the valid service of 2012 and put them into your C#/VB.NET project. If you are unsure of how to download and adapt proxy classes I have a more detailed thread on it here: Programmatically Export SSRS report from sharepoint using ReportService2010.asmx

// 
// This source code was auto-generated by xsd, Version=4.0.30319.17929.
// 
namespace SampleRDLSchema {
    using System.Xml.Serialization;

 /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition", IsNullable=false)]

B.

  1. Find a local copy on the disk of an 'RDL' report and copy it.
  2. Take the copy and open it with a text editor, I would use Notepad++ or something similar.
  3. RDL as a language to me has not really change all that much, (I don't even see the differences in the designer between 2008R2 and 2012). So along that lines you could try a hack and see if it could work. Edit the node of '< Report' near the top to be this instead:

    < Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition">
    
like image 26
djangojazz Avatar answered Sep 23 '22 07:09

djangojazz