2017 年 Visual studio RDLC 的奇怪编辑

Weird editor of RDLC in Visual studio 2017

我有一个 rdlc(定义是 2010)并试图在 Visual studio 2017(社区)中编辑它。

当我在设计器中打开它时(这是一个单独的扩展,需要安装)

它要求我将 RDLC 更新到最新版本。

更新 RDLC 后,我可以在 visual studio 2017 年编辑它。

但编辑后的 ​​RDLC 无法呈现(定义更新至 2016)

http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition

如果我选择更新,报表查看器可以正确显示报表。

然后我尝试搜索为什么 reportViewer 无法呈现定义 2016 RDLC。

我发现Visual studio2017的reportViewer版本是12.

根据网络信息,最新版本的报表查看器是14。

而且我发现实际上没有办法将报告查看器更新到 14(至少在社区版本中)。

我很好奇为什么 visual studio 2017 年的处理会那么糟糕

RDLC 设计者 迫使我们在 visual studio 2017

中将 RDLC 更新为 2016 定义

但是无法更新 查看器 以使用 2016 定义呈现报告

已安装的东西:

设计师在 VS2017 中查看 RDLC 时要求我更新

无法在 ReportViewer 中呈现更新的 RDLC

如果选择不更新,reportViewer可以显示,但设计者不能查看和编辑RDLC

2017 年 Visual Studio RDLC 有几个不同的组成部分。

设计师

作为扩展安装 - 您需要它来编辑您的报告。我知道这是你已经拥有的:
Microsoft Rdlc Report Designer for Visual Studio (marketplace.visualstudio.com)

Projects/Wizards

一个单独的扩展。将用于创建新 projects/reports.

的项目和向导添加到 Visual Studio

Microsoft Reporting Services Projects (marketplace.visualstudio.com)

扩展名 links 仅用于说明,您可以在 Visual Studio 中找到它们:
工具 -> 扩展和更新 -> 联机。

ReportViewerControl

对于您拥有的每个使用 ReportViewer 的项目,您需要 ReportViewerControl NuGet 包来为您提供更新的查看器:

对于 Winforms(或 WPF 通过 WindowsFormsHost (docs.microsoft.com)):

Microsoft.ReportingServices.ReportViewerControl.Winforms (nuget.org)

对于ASP.Net(个人从未使用过):

Microsoft.ReportingServices.ReportViewerControl.WebForms (nuget.org)

同样,links 仅用于说明,您可以在 Visual Studio 中找到:
工具 -> NuGet 包管理器 -> 管理解决方案的 NuGet 包 -> 浏览。

注意:一定要安装正确的 nuget 包。如果你来自 VS2015,你之前可能安装了非官方包。仔细检查名称(如果需要确认,请输入 link)。截图如下:

更多信息

Integrating Reporting Services Using the Report Viewer Controls - Get Started (docs.microsoft.com)