SQL 上传报告时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35922626/
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
Error while uploading a report
提问by Abe
I have create a report using visual studio 2015 with SSDT Tools installed from the following link
我使用 Visual Studio 2015 创建了一份报告,并从以下链接安装了 SSDT 工具
https://msdn.microsoft.com/en-us/mt186501
https://msdn.microsoft.com/en-us/mt186501
The database is on SQL Server 2014. The reports work on my machine however when I try to upload a report on customers machine(Which has SQL Server 2014 and not visual studio). I get the following error
数据库在 SQL Server 2014 上。但是当我尝试在客户机器上上传报告时,报告在我的机器上工作(有 SQL Server 2014 而不是 Visual Studio)。我收到以下错误
"The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' which cannot be upgraded. (rsInvalidReportDefinition)"
“此报表的定义无效或受此版本的 Reporting Services 支持。报表定义可能是使用更高版本的 Reporting Services 创建的,或者包含格式不正确或基于 Reporting Services 架构无效的内容. 详细信息:报告定义具有无效的目标命名空间 ' http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' 无法升级。(rsInvalidReportDefinition)"
回答by Andrew Failor
If you have the solution > properties > TargetServerVersion set to SQL Server 2008 R2, 2012 or 2014 and then upload the RDL from the bin folder instead of the project folder, it should work. I was getting the same error and that solved it.
如果您将解决方案 > 属性 > TargetServerVersion 设置为 SQL Server 2008 R2、2012 或 2014,然后从 bin 文件夹而不是项目文件夹上传 RDL,它应该可以工作。我遇到了同样的错误并解决了它。
回答by Ed Elliott
Your report is targeting SQL server 2016
您的报告针对的是 SQL Server 2016
回答by Shailesh Prajapati
If you are used Visual studio 2017
如果您使用的是Visual Studio 2017
Update: Microsoft released a document on April-18, 2017 describing how to configure and use the reporting tool in Visual Studio 2017.
更新:Microsoft 于 2017 年 4 月 18 日发布了一份文档,描述了如何在 Visual Studio 2017 中配置和使用报告工具。
Visual Studio 2017 does not have the ReportViewer tool installed by default in the ToolBox. Installing the extension Microsoft Rdlc Report Designer for Visual Studio and then adding that to the ToolBox results in a non-visual component that appears below the form.
Visual Studio 2017 的工具箱中默认没有安装 ReportViewer 工具。安装 Microsoft Rdlc Report Designer for Visual Studio 扩展,然后将其添加到 ToolBox 会导致出现在窗体下方的非可视组件。
Microsoft Support had told me this is a bug, but as of April 21, 2017 it is "working as designed".
Microsoft 支持人员告诉我这是一个错误,但截至 2017 年 4 月 21 日,它“按设计工作”。
The following steps need to be followed for each project that requires ReportViewer.
每个需要 ReportViewer 的项目都需要遵循以下步骤。
If you have ReportViewer in the Toolbox, remove it. Highlight, right-click and delete. You will have to have a project with a form open to do this. If you have the Microsoft Rdlc Report Designer for Visual Studio extension installed, uninstall it. Close your solution and restart Visual Studio. This is a crucial step, errors will occur if VS is not restarted when switching between solutions. Open your solution. Open the NuGet Package Manager Console (Tools/NuGet Package Manager/Package Manager Console) At the PM> prompt enter this command, case matters.
如果工具箱中有 ReportViewer,请将其删除。突出显示,右键单击并删除。您必须有一个打开表单的项目才能执行此操作。如果您安装了 Microsoft Rdlc Report Designer for Visual Studio 扩展,请将其卸载。关闭您的解决方案并重新启动 Visual Studio。这是很关键的一步,如果切换解决方案时没有重启VS,就会出现错误。打开您的解决方案。打开 NuGet 包管理器控制台(工具/NuGet 包管理器/包管理器控制台)在 PM> 提示符下输入此命令,大小写很重要。
Install-Package Microsoft.ReportingServices.ReportViewerControl.WinForms
安装包 Microsoft.ReportingServices.ReportViewerControl.WinForms
You should see text describing the installation of the package.
您应该会看到描述软件包安装的文本。
I hope its working
我希望它的工作
回答by Khushboo Tahir
That one worked for me: getting SSRS version 2016 error, need to edit rdlc report. For detailed step visit this link: http://eskonr.com/2018/06/configmgr-ssrs-failed-to-upload-rdl-with-error-code-definition-of-this-report-is-not-valid-or-supported-by-this-version-of-reporting-services/
那个对我有用:出现 SSRS 2016 版错误,需要编辑 rdlc 报告。有关详细步骤,请访问此链接:http: //eskonr.com/2018/06/configmgr-ssrs-failed-to-upload-rdl-with-error-code-definition-of-this-report-is-not-valid -or-supported-by-this-version-of-reporting-services/
Changes:
变化:
- Search 2016, change the version from 2016to 2010.
- Search for "ReportParametersLayout"in file and remove the whole block (This code is created on 2016 version of visual studio).
- 搜索 2016 ,将版本从2016更改为2010。
- 在文件中搜索 “ReportParametersLayout”并删除整个块(此代码是在 Visual Studio 2016 版本上创建的)。
As shown above, remove the whole block and save the report.
如上所示,删除整个块并保存报告。
回答by Dot Net developer
Although the question is answered but this solution might help for the new visits.
尽管问题已得到解答,但此解决方案可能对新访问有所帮助。
In Visual Studio, go to tools -> Extensions and updates -> updates -> Update Reporting services.
在 Visual Studio 中,转到工具 -> 扩展和更新 -> 更新 -> 更新报告服务。
After you close Visual Studio, it installs an VSiX installer .
关闭 Visual Studio 后,它会安装一个 VSiX 安装程序。
The problem was solved for me. Hope this helps.
问题为我解决了。希望这可以帮助。
回答by Waqas Javaid
I right clicked on my report and then clicked publish report1.rdlc
which worked for me.
我右键单击我的报告,然后单击publish report1.rdlc
哪个对我有用。
回答by Michel van Engelen
None of the proposed solutions worked for me, while I correctly have set the TargetServerVersionin the project properties. Note that I don't think that manually editing the .rdl file is a solution that is sustainable.
没有一个建议的解决方案对我有用,而我在项目属性中正确设置了TargetServerVersion。请注意,我认为手动编辑 .rdl 文件不是可持续的解决方案。
I do have a strange solution: In the IDE (Visual Studio 2019 in my case) change the Solution Configuration from Debugto DebugLocal. Now change the TargetServerVersionto any version you'd like, rebuild the report project and inspect the .rdl file, with any text editor, in the bin\DebugLocal folder.
我确实有一个奇怪的解决方案:在 IDE(在我的例子中是 Visual Studio 2019)中,将解决方案配置从Debug更改为DebugLocal。现在将TargetServerVersion更改为您想要的任何版本,重建报告项目并使用任何文本编辑器检查 bin\DebugLocal 文件夹中的 .rdl 文件。
You'll notice now that the namespaces DO react on every change to TargetServerVersion+ rebuild.
您现在会注意到,命名空间确实会对 TargetServerVersion+ 重建的每次更改做出反应。
Note: this only seems to work when the Solution Configuration has been set to DebugLocal, not for Debugor Release!!
注意:这似乎仅在解决方案配置已设置为DebugLocal 时才有效,不适用于Debug或Release!
回答by user3743873
I got the answer from link "https://www.sqlskills.com/blogs/tim/issue-publishing-to-ssrs-2012-with-ssdt-2015/"
我从链接“ https://www.sqlskills.com/blogs/tim/issue-publishing-to-ssrs-2012-with-ssdt-2015/”得到了答案
Issue publishing to SSRS 2012 with SSDT 2015 By: Tim Radney Posted on: January 22, 2016 2:58 pm I recently was helping a client who was trying to use SQL Server Data Tools 2015 to update and generate reports that would be deployed to SQL Server Reporting Services 2012. When trying to deploy the report, the client would get the following error:
使用 SSDT 2015 发布到 SSRS 2012 的问题 作者:Tim Radney 发布时间:2016 年 1 月 22 日下午 2:58 我最近正在帮助一个试图使用 SQL Server Data Tools 2015 更新和生成将部署到 SQL 的报告的客户Server Reporting Services 2012。尝试部署报表时,客户端会收到以下错误:
“[rsInvalidReportDefinition] The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas.”
“[rsInvalidReportDefinition] 此报告的定义无效或受此版本的 Reporting Services 支持。报告定义可能是使用更高版本的 Reporting Services 创建的,或者包含格式不正确或基于 Reporting Services 架构无效的内容。”
I knew that SSDT 2015 should be backwards compatible and able to work with multiple versions of SQL Server products, so I had to do a little research to figure out what exactly needed to be changed in order to publish a report to SSRS 2012.
我知道 SSDT 2015 应该向后兼容并且能够与多个版本的 SQL Server 产品一起使用,所以我不得不做一些研究来弄清楚究竟需要改变什么才能向 SSRS 2012 发布报告。
In my lab, I created a new project named GetDatabases. This project was a basic report that would get query a system table. The first thing I tried to change in the project was the TargetServerVersion located under the project properties.
在我的实验室中,我创建了一个名为 GetDatabases 的新项目。这个项目是一个可以查询系统表的基本报告。我尝试在项目中更改的第一件事是位于项目属性下的 TargetServerVersion。
I updated the TargetServerVersion to “SQL Server 2008 R2, 2012, or 2014”, the default in was “SQL Server 2016”. I also updated the TargetServerURL to my development server running SSRS 2012. I made these changes to both the release and debug configuration options.
我将 TargetServerVersion 更新为“SQL Server 2008 R2、2012 或 2014”,默认为“SQL Server 2016”。我还将 TargetServerURL 更新为运行 SSRS 2012 的开发服务器。我对发布和调试配置选项进行了这些更改。
After making these changes, I was still unable to deploy the report. After a bit more research, I found a location to change the default deployment server version of the Business Intelligence Designer. This is located under ‘Tools and then Options'. The default was set to version 13.0, once I changed the version to 11.0 to match the server I was deploying to, I was able to successfully deploy my report to SSRS 2012.
进行这些更改后,我仍然无法部署报告。经过更多研究,我找到了一个位置来更改商业智能设计器的默认部署服务器版本。它位于“工具,然后是选项”下。默认设置为版本 13.0,一旦我将版本更改为 11.0 以匹配我部署到的服务器,我就能够成功地将我的报告部署到 SSRS 2012。