问题
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
回答1:
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\
回答2:
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.
- Find a local copy on the disk of an 'RDL' report and copy it.
- Take the copy and open it with a text editor, I would use Notepad++ or something similar.
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">
回答3:
Mário Meyrelles is right.
It's all about Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WinForms.dll version. Please make sure that you referred to correct or latest dll version. e.g. for VS2013, we should use version 11.
C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll
C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.dll
回答4:
I had started a Reporting Project with SQL2008 R2 and all the project files were using the schema:
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/
My reporting server is SQL2008 NOT R2 and deploying the reports resulted in the error:
The report definition is not valid. Details: The report definition has an invalid target namespace
The trick is to set the projects TargetServerVersion to SQL 2008 and Build. Then all the files in the Bin\Release folder will have the correct schema, eg
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/
来源:https://stackoverflow.com/questions/17243754/visual-studio-2010-the-report-definition-is-not-valid-details-the-report-defi