【问题标题】:RDLC report stop working after change Visual Studio 2015 to Visual Studio 2017将 Visual Studio 2015 更改为 Visual Studio 2017 后 RDLC 报告停止工作
【发布时间】:2017-12-18 19:38:12
【问题描述】:

我在 Visual Studio 2017 中有一个 AspNet MVC 项目,该项目之前是在 Visual Studio 2015 中开发的。该项目包含许多 rdlc 文件,在我编辑其中一个之前,它们都运行良好。现在,当我尝试从已编辑的 rdlc 下载 pdf 时,出现此错误:

此报告的定义无效或不受此支持 报告服务的版本。报告定义可能是 使用更高版本的 Reporting Services 创建的,或包含内容 根据 Reporting Services 格式不正确或无效 模式。详细信息:报告定义的目标无效 命名空间 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' 无法升级。

编辑的 rdlc 将其命名空间从 http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition 更改为 http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition

该项目使用 net framework 4.6.2 运行,并且已安装 Microsoft.ReportViewer.Runtime.Common.12.0.2402.15Microsoft.ReportViewer。 Runtime.WebForms.12.0.2402.15 nuget 包

【问题讨论】:

    标签: c# asp.net-mvc visual-studio-2017 rdlc


    【解决方案1】:

    我有同样的问题,我解决了它卸载 nuget 包 Microsoft.ReportViewer.Runtime.CommonMicrosoft.ReportViewer.Runtime.WebForms 并安装包 Microsoft.ReportingServices.ReportViewerControl.WebForms.140.340.80。我想强调我必须添加对 System.Windows.Forms 的引用,因为我用来呈现报告的 ReportDataSource 类中有一个依赖项

    【讨论】:

    • nuget.org/packages/… Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms -Version 140.802.134
    • Fidel 感谢您清楚地提出这个问题,非常感谢 Lilliam 的回答。这是 3 天我一直在寻找解决方案。对于那些正在寻找 WPF 应用程序解决方案的人,您需要安装此软件包:Microsoft.ReportingServices.ReportViewerControl.Winforms.140.340.80
    • 我在 WebApi 2.0 中遇到了同样的问题...场景不同,我没有使用 Microsoft.ReportViewer.Runtime.WebForms,我只使用了 Microsoft.ReportViewer.Runtime .普通...
    • 此解决方案有效,还请确保您的 RDLC 报告的属性“构建操作”设置为“内容”,在我的情况下设置为“嵌入式资源”并且它正在生成错误当我发布到生产服务器时。如果您的 RDLC 报告使用 .resx 文件,还要验证它们是否存在于各自的文件夹中。
    • 还有一点要考虑,为“Microsoft.SqlServer.Types”版本14安装nuget包,当然我们的项目是dotnet,我们的db是microsoft sql server
    【解决方案2】:

    我在解决方案资源管理器中右键单击 rdlc 文件并选择从服务器替换,它为我解决了问题。我认为 vs 2017 尝试更新架构以使用不同版本的 sql server 并获取原始报告定义来修复它。也许,我不知道,但它对我有用。

    【讨论】:

    • 它把模式改回了这个,schemas.microsoft.com/sqlserver/reporting/2008/01/…" xmlns:rd="schemas.microsoft.com/SQLServer/reporting/reportdesigner"> 从类似这样的东西 schemas.microsoft.com/sqlserver/reporting/2016/01/…" xmlns: rd="schemas.microsoft.com/SQLServer/reporting/reportdesigner"> 为我。
    • 我不确定你的回答是关于什么的。你能解释更多吗?
    • 这个答案既没有发现问题也没有提供永久的解决方案——很明显,提出问题的人需要能够编辑 RDLC 文件,而不仅仅是从服务器中提取它。
    猜你喜欢
    • 2017-08-25
    • 2016-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多