【问题标题】:RDLC report in Windows Forms using Visual Studio 2012使用 Visual Studio 2012 在 Windows 窗体中生成 RDLC 报告
【发布时间】:2015-03-13 07:20:48
【问题描述】:

开发环境:Visual Studio 2012 Professional、RDLC、Windows Forms、SQL Server 2012、Entity Framework 5.0

我正在使用 Visual Studio 2012 在 Windows 窗体中处理 RDLC,我遇到了无法在 Windows 窗体中填充我的 RDLC 报告的问题。我在下面提供了启动 RDLC 的主要步骤。

  • 第 1 步:我为我的报告创建了数据集。
  • 第 2 步:然后生成 RDLC 报告
  • 第 3 步:在 Windows 窗体中将报表与 Reportviewer 绑定。
  • 第 4 步:通过 Windows 窗体运行我的应用时,报告中不显示任何内容。

谁能帮我这个。如果您向我提供通过代码启动 RDLC 报告的代码,那就太好了。我试图附加我的应用程序的快照,但不可能。

【问题讨论】:

  • 我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
  • 请不要将那些“Windows 窗体、C#、RDLC”放在标题之外。它们只属于标签。
  • 这可以是任何东西。不看代码就无法判断。
  • 我需要通过代码而不是 dataset1.xsd 填充 RDLC 报告,我搜索了程序但没有选择任何明确的程序。我正在使用实体框架 5.0

标签: c# winforms visual-studio-2012 rdlc sql-server-2012-express


【解决方案1】:

这里详细描述了您需要的内容:https://msdn.microsoft.com/en-us/library/aa337089.aspx

“在本地处理模式下查看报告”部分给出了完整的示例。

【讨论】:

  • 帮我提供了你提供的链接,最后我在代码中添加了几行代码以成功执行RDLC报告 DataTable dt = new DataTable(); dt = PopulateDt(dt); this.bindingSource1.DataSource = dt; ReportDataSource _rep = new ReportDataSource("vw_Student", this.bindingSource1); reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.LocalReport.DataSources.Add(_rep); reportViewer1.RefreshReport();
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-28
  • 1970-01-01
  • 2021-09-19
  • 1970-01-01
相关资源
最近更新 更多