RDLC报表跳转到另一个报表

本文关键字:报表 另一个 RDLC | 更新日期: 2023-09-27 18:02:38

(Windows应用程序)

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

我已经在我的工程中添加了Report1.Rdlc。上面有一个TextBoxName。我想做的是在TextBoxName点击我想跳上Report2.Rdlc,但当我设置TextboxName的属性Report2不显示在下拉菜单

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

我采取Crystalreportviewer Report1和在CrystalreportViewer任务我选择Report1所以Report2将在同一查看器中打开..?????

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

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

i Also Give only Name

Report2.rdlc

RDLC报表跳转到另一个报表

这段代码将帮助您打开Report2在相同的报告查看器TextBoxName点击。

 // ---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

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

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

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