.net Visual Studio 2010:报告定义无效。详细信息:报告定义的目标无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17243754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2010: The report definition is not valid. Details: The report definition has an invalid target
提问by Mac McCaskie
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.
回复:报告定义无效。详细信息:报告定义具有无效的目标命名空间“ http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition”,无法升级。
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
1) 带有 SQL Server 2012 的 Visual Studio 2010
2) App is a winforms vb.net, has been working great, was originally developed in VS 2008
2) App 是一个 winforms vb.net,一直很好用,最初是在 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.
3) 尝试编辑一些报告 - 自升级到 SQL 2012 以来的第一次。
4) Could not edit the datasets and decided something was corrupt.
4) 无法编辑数据集并确定某些内容已损坏。
5) Ran a repair installation on VS 2010 and ensured it was fully up-to-date. no joy - could not update dataset.
5) 在 VS 2010 上运行修复安装并确保它是完全最新的。不高兴 - 无法更新数据集。
6) Re-ran install for SQL SSMS with addition of SDK for connectivity clients
6) 重新安装 SQL SSMS 并为连接客户端添加 SDK
7) Now I could edit the report datasets, but the reports are broken. (see title) -double sigh-
7) 现在我可以编辑报告数据集,但报告已损坏。(见标题)-双叹-
Report viewer is 10.0.0
报表查看器是 10.0.0
.Net is 4.0
.Net 是 4.0
Thanks for any tips
感谢您的任何提示
Mac McCaskie
麦克麦卡斯基
回答by Mário Meyrelles
I had this issue today in VS2013.
我今天在 VS2013 中遇到了这个问题。
Be sure to reference the correct ReporViewer dll version:
请务必参考正确的 ReporViewer dll 版本:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\ReportViewer\
C:\Program Files (x86)\Microsoft Visual Studio 12.0\ReportViewer\
回答by djangojazz
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.
如果我没记错的话,我认为修复可能比您预期的要简单。您的名称空间只需要更改以引用较新的服务。据我所知,您不能在 2008 名称空间上运行 2012。但是,当您提到“Winforms”应用程序时,我感到困惑,该应用程序通过通常以多种方式设置的查看器与 SQL 报告服务进行间接对话。如果是这种情况,请遵循下面的 A,但是您提到直接编辑报告,所以我很好奇这些客户报告是否直接在应用程序中?如果是这样,我会假设如果是这种情况,您正在谈论带有 RDL 报告的 SSRS 2012,在这种情况下,如果这是使用商业智能开发工作室添加创建的报告托管报告,我会尝试 B,如果这是从 SQL 2012 创建的 VS 2010。
A:
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
您可以永远重新安装 2012,但不能让它使用 2008 的命名空间来存储数据。您需要使用 2012 年有效服务中最新的代理类,并将它们放入您的 C#/VB.NET 项目中。如果您不确定如何下载和调整代理类,我在这里有一个更详细的主题: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.
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">
- 在“RDL”报告的磁盘上找到一个本地副本并复制它。
- 获取副本并用文本编辑器打开它,我会使用 Notepad++ 或类似的东西。
RDL 作为一种语言对我来说并没有真正改变太多(我什至没有看到 2008R2 和 2012 之间设计器的差异)。所以沿着这条线你可以尝试一个黑客,看看它是否可以工作。将顶部附近的 '< Report' 节点编辑为:
< 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">
回答by NAY MYO KYAW
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.
这都是关于 Microsoft.ReportViewer.Common.dll 和 Microsoft.ReportViewer.WinForms.dll 版本的。请确保您引用了正确或最新的 dll 版本。例如对于 VS2013,我们应该使用版本 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.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
C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.dll
回答by Jeremy Thompson
I had started a Reporting Project with SQL2008 R2and all the project files were using the schema:
我用 SQL2008 R2开始了一个报告项目,所有的项目文件都使用了这个架构:
<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:
我的报告服务器是 SQL2008 NOT R2 并且部署报告导致错误:
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
诀窍是将项目 TargetServerVersion 设置为 SQL 2008 和 Build。然后 Bin\Release 文件夹中的所有文件都将具有正确的架构,例如
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/


