C# 报告定义无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15675248/
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
The report definition is not valid
提问by Atul Phadtare
I have converted an .rdlc
rerort from SSRS 2005 to SSRS 2008. Now when I am going to build that project I have got error.
我已将.rdlc
SSRS 2005的rerort转换为 SSRS 2008。现在,当我要构建该项目时,出现错误。
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”,无法升级。
Please give me solution for this.
请给我解决方案。
回答by gdawgrancid
Just stumbled upon this question since I was having the same problem. In my case, I had a reference to an older version of ReportViewer.WinForms. When I switched versions, everything worked fine. Might not be the same case as yours, but just thought I'd chime in in case anyone else finds this page.
只是偶然发现了这个问题,因为我遇到了同样的问题。就我而言,我参考了旧版本的 ReportViewer.WinForms。当我切换版本时,一切正常。可能与您的情况不同,但我只是想以防万一其他人找到此页面。
回答by Ted Spence
I encountered this same problem, and the solution for me was to edit the file:
我遇到了同样的问题,我的解决方案是编辑文件:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0
\ReportingServices\Microsoft.ReportingServices.targets
And change line #2, which previously said this:
并更改第 2 行,该行之前说过:
<UsingTask TaskName="Microsoft.Reporting.RdlCompile"
AssemblyName="Microsoft.ReportViewer.Common, Version=9.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
To this:
对此:
<UsingTask TaskName="Microsoft.Reporting.RdlCompile"
AssemblyName="Microsoft.ReportViewer.WebForms, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Once that was done, my program started compiling again.
完成后,我的程序再次开始编译。
回答by user2702793
I had exacty the same problem. For me the solution was to exclude the report from the project and to add it again. After that it compiled successfully.
我有完全相同的问题。对我来说,解决方案是从项目中排除报告并再次添加。之后就编译成功了。
回答by Rubarb
It might be a conversion problem. Recreate a new 2008 report. And I suggest using VS2010. I have the same problem when editing a report with VS2012.
可能是转换问题。重新创建新的 2008 年报告。我建议使用 VS2010。我在用 VS2012 编辑报告时遇到了同样的问题。
回答by Rafs2
I'm not entirely sure why @user2702793's answer got down voted, because that suggestion just saved my career:
我不完全确定为什么@user2702793 的答案被否决了,因为这个建议挽救了我的职业生涯:
Consider
考虑
- Creating a blank SSRS 2008 report and copying all the content out of the SSRS 2005 report into the new one
- copy the name of the SSRS 2005 report if you want to keep the name of the report intact
- delete that report (SSRS 2005 one you just copied the content from into your new report)
- rename your new SSRS 2008 (with the deleted SSRS 2005 report's content in it) and paste the report name in.
- 创建一个空白的 SSRS 2008 报告并将 SSRS 2005 报告中的所有内容复制到新报告中
- 如果要保持报告名称不变,请复制 SSRS 2005 报告的名称
- 删除该报告(您刚刚将内容复制到新报告中的 SSRS 2005 报告)
- 重命名您的新 SSRS 2008(其中包含已删除的 SSRS 2005 报告的内容)并粘贴报告名称。
I had a very similar situation mentioned above except I wanted to retain my SSRS old versions instead of upgrading it. Which basically had me making a copy of the old version, copying the content out of the accidentally upgraded report and pasting it into the copied report, and copying the name of the upgraded report, deleting it and renaming my copied report to retain the same name of the report that just got deleted.
我遇到了上面提到的非常相似的情况,只是我想保留我的 SSRS 旧版本而不是升级它。这基本上让我复制旧版本,从意外升级的报告中复制内容并将其粘贴到复制的报告中,并复制升级后的报告的名称,将其删除并重命名我复制的报告以保留相同的名称刚刚被删除的报告。
Edit: Of course in my case I also wanted changes done to the old report which was all in the upgraded report hence my lengthy work around to keep from losing my current changes.
编辑:当然,在我的情况下,我还希望对旧报告进行更改,这些更改都在升级报告中,因此我进行了冗长的工作以防止丢失当前更改。
回答by Jeff Anderson
回答by André Luiz Silveira
In ReportViewer properties in webform expand LocalReport/Path in the field put the correct path of report
在 webform 的 ReportViewer 属性中,在字段中展开 LocalReport/Path 放置正确的报告路径
- This works for me...
- 这对我有用...
回答by Hany Hassan
I faced an almost similar problem but in another version of visual studio ( 2012) and i found out that the problem was from the version of Microsoft.ReportViewer.WebForms.dll or winforms. You may be still referencing the old one related to your current version of visual studio so check the dll version and if so remove it and add the latest one
我遇到了几乎类似的问题,但在另一个版本的 Visual Studio(2012)中,我发现问题出在 Microsoft.ReportViewer.WebForms.dll 或 winforms 版本中。您可能仍在引用与您当前版本的 Visual Studio 相关的旧版本,因此请检查 dll 版本,如果是,请将其删除并添加最新版本