简体   繁体   English

Visual Studio 2010:报表定义无效。 详细信息:报表定义的目标无效

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

Re: The report definition is not valid. Re:报告定义无效。 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)Visual Studio 2010,带有SQL Server 2012

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. 5)在VS 2010上安装修复装置并确保它完全是最新的。 no joy - could not update dataset. 没有快乐 - 无法更新数据集。

6) Re-ran install for SQL SSMS with addition of SDK for connectivity clients 6)为连接客户端添加SDK,重新运行SQL SSMS的安装

7) Now I could edit the report datasets, but the reports are broken. 7)现在我可以编辑报告数据集,但报告已被破坏。 (see title) -double sigh- (见标题) - 双叹 -

Report viewer is 10.0.0 报告查看器是10.0.0

.Net is 4.0 .Net是4.0

Thanks for any tips 谢谢你的任何提示

Mac McCaskie 麦克麦卡斯基

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 \\

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. 据我所知,您无法在2008命名空间上运行2012。 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. 我很困惑,因为你提到了'Winforms'应用程序,该应用程序通过一般以多种方式设置的查看器间接地与SQL报告服务交谈。 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? 如果是这种情况,请按照下面的A进行,但是你提到直接编辑报告,所以我很好奇这些客户报告是否直接在应用程序中? 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. 如果是这样的话,我会假设你是在谈论带有RDL报告的SSRS 2012,在这种情况下我会尝试B,如果这是用于使用从SQL 2012创建的VS 2010上的Business Intelligence Development Studio添加创建的报告托管报告。如果你在谈论本地存储在VB.NET应用程序中的客户端报告,我可能会猜到它们可能已经升级到使用.NET 4.5的2012,你可能正在尝试更低的框架,但这只是猜测最后一个并且由于.NET带有以前的版本,因此我不会认为它会在不告诉你的情况下升级报告。

A: A:

You can re install 2012 forever but not get it to use 2008's namespace for data. 您可以永久重新安装2012,但不能使用2008的数据库命名空间。 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. 您需要使用2012年有效服务中的最新代理类,并将它们放入C#/ VB.NET项目中。 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 如果您不确定如何下载和调整代理类,我在此处有一个更详细的线程: 使用ReportService2010.asmx以编程方式从sharepoint导出SSRS报告

// 
// 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.

  1. Find a local copy on the disk of an 'RDL' report and copy it. 在“RDL”报告的磁盘上查找本地副本并将其复制。
  2. Take the copy and open it with a text editor, I would use Notepad++ or something similar. 拿起副本并用文本编辑器打开它,我会使用Notepad ++或类似的东西。
  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). RDL作为一种语言对我来说并没有真正改变,(我甚至没有看到设计师在2008R2和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”节点代替:

     < 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"> 

Mário Meyrelles is right. MárioMeyrelles是对的。

It's all about Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WinForms.dll version. 这都是关于Microsoft.ReportViewer.Common.dll和Microsoft.ReportViewer.WinForms.dll版本的。 Please make sure that you referred to correct or latest dll version. 请确保您引用了正确或最新的dll版本。 eg for VS2013, we should use version 11. 例如,对于VS2013,我们应该使用版本11。

C:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ReportViewer.Common\\11.0.0.0__89845dcd8080cc91\\Microsoft.ReportViewer.Common.dll C:\\ WINDOWS \\装配\\ 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 \\装配\\ GAC_MSIL \\ Microsoft.ReportViewer.WinForms \\ 11.0.0.0__89845dcd8080cc91 \\ Microsoft.ReportViewer.WinForms.dll

I had started a Reporting Project with SQL2008 R2 and 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. 诀窍是将项目TargetServerVersion设置为SQL 2008和Build。 Then all the files in the Bin\\Release folder will have the correct schema, eg 然后Bin \\ Release文件夹中的所有文件都将具有正确的架构,例如

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VS2018 WebApi中的rdlc:报告定义的目标名称空间无效,无法升级 - rdlc in VS2018 WebApi : The report definition has an invalid target namespace which cannot be upgraded 在Visual Studio 2010上报告应用程序 - Report Application on Visual Studio 2010 未指定报告定义的来源3 - The source of the report definition has not been specified 3 如何在Visual Studio 2010中将Crystal报表加载到报表查看器? - How to load crystal report to report viewer in visual studio 2010? Visual Studio 2010,Visual Studio 2008和ClickOnce的Crystal Report - Visual Studio 2010, Crystal Report for Visual Studio 2008 and ClickOnce 报告定义的来源尚未指定 windows forms 应用程序 - the source of the report definition has not been specified windows forms application 是否可以在 Visual Studio 2010 中调用 SSRS 2008 R2 报告? - Is it possible to call SSRS 2008 R2 report in Visual Studio 2010? ReportViewer错误 - 报告的定义“无效。无法加载文件或程序集Microsoft.ReportViewer.ProcessingObjectMode - ReportViewer error - The definition of the report " is invalid. Could not load file or assembly Microsoft.ReportViewer.ProcessingObjectMode 无法在Visual Studio 2010中定位.NET 2.0 - Unable to target .NET 2.0 in Visual Studio 2010 更改默认目标框架Visual Studio 2010 - Changing the Default Target Framework Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM