【问题标题】:RDLC Report Jump to Another ReportRDLC 报告 跳转到另一个报告
【发布时间】:2016-12-23 15:28:20
【问题描述】:

(Windows 应用程序)

我对 RDLC 报告非常陌生,我的项目中有深入报告。我阅读了许多论坛和教程,但没有找到任何解决方案。

我在我的项目中添加了Report1.Rdlc。上面有一个 TextBoxName。我想做的是在TextBoxName 点击我想跳到Report2.Rdlc 但是当我设置TextboxName 的属性时,Report2 没有显示在下拉菜单中

当我观看该下拉菜单中的视频时,如果 Project 中有任何 rdlc 报告,则会自动出现,但在我的情况下它没有

我将Crystalreportviewer 用于Report1 并在CrystalreportViewer 任务中选择 Report1 所以 Report2 将在同一查看器中打开..?????

我试图在表达式中给出路径,例如

="D:\MyProject\ReportingViews\Report2.rdlc"

我也只给出名字

Report2.rdlc

【问题讨论】:

  • 你能展示更多关于你的填充/加载行为实现的代码吗?
  • 您提供的代码量不足。请提供更多代码,以便我们轻松了解您的需求。

标签: c# rdlc


【解决方案1】:

我不确定您所说的报告属性。如果您想从报表查看器打开多个报表,那么您可以在代码页中这样做。

if(ddlDropdown.SelectedValue == 1)
{
 ReportViewer.LocalReport.ReportPath = "ReportsFolder\\report1.rdlc";
}
else if(ddlDropdown.SelectedValue == 2)
{
ReportViewer.LocalReport.ReportPath = "ReportsFolder\\report2.rdlc";
}

【讨论】:

    【解决方案2】:

    此代码将帮助您在 TextBoxName Click 上的同一报表查看器中打开 Report2。

     // ---Load Report1 in report viewer on form load---
    reportViewer1.LocalReport.ReportPath = Application.StartupPath + @"\Report1.rdlc"; //Here we set Set Report1 file path;
    reportViewer1.RefreshReport();
    
    //---Load Report2 in same report viewer on TextBoxName Click 
    reportViewer1.LocalReport.ReportPath = Application.StartupPath + @"\Report2.rdlc"; //Here we set Set Report2 file path
    reportViewer1.RefreshReport();
    

    确保 Report1 和 Report2 的 File 属性如下

    构建动作 = 内容

    复制到输出目录 = 始终复制

    【讨论】:

      猜你喜欢
      • 2019-01-08
      • 1970-01-01
      • 1970-01-01
      • 2020-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多