Visual Studio 获取数据但不显示

Visual Studio fetches data but not display

我已经阅读了Whosebug 上的所有相关答案。 Reportviewer 永远不会填满。 有数据但不显示

我没有更新我的项目,而是从头开始创建了一个新项目,此时,我看到 reportviewer 正在正常工作。这是我的步骤;

Visual Studio 2019 年或 2022 年

1 - 在顶部菜单中单击扩展 --> 管理扩展 --> 搜索“Microsoft RDLC 报告设计器”或“Microsoft RDLC 报告设计器 2022” 下载并安装“Microsoft RDLC Report Designer”并重新启动 Visual Studio

2 - 添加 Report.rdlc 个文件到项目中 使用管理 nuget 包, 搜索 Microsoft.ReportingServices.ReportViewerControl.WebForms 并安装

3 - 在工具箱中,在“Microsoft Sql Server”下可以看到 ReportViewer (如果看不到,请单击工具箱中的任意位置并 select 选择项目并添加 ReportViewer)

4 -新建一个aspx文件 将 ReportViewer 控件拖到此 aspx 文件并添加您的 rdlc 文件

5 - 当您在浏览器中打开页面时,您将看到该报告。