gpt4 book ai didi

c# - RDLC 报告跳转到另一个报告

转载 作者:太空狗 更新时间:2023-10-29 23:13:04 26 4
gpt4 key购买 nike

(Windows 应用程序)

我对 RDLC 报告还很陌生,我的项目中有向下钻取报告。我阅读了许多论坛和教程,但没有找到任何解决方案。

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

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

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

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

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

我也只给名字

Report2.rdlc

最佳答案

此代码将帮助您在单击 TextBoxName 时在同一报表查看器中打开 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属性如下

Build Action = Content

Copy to output directory = Copy always

关于c# - RDLC 报告跳转到另一个报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38988724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com