【发布时间】:2014-06-06 13:17:07
【问题描述】:
我想通过资源文件设置子报表标题文本。这是我在下面尝试过的代码
ReportDocument rDocument = (ReportDocument)Session["ReportSource"];
((TextObject)rDocument.Subreports["HolidaySubReport"].ReportDefinition.
ReportObjects["HolidaySchedule"]).Text=Resources.Resources.HolidaySchedule;
但是在这里我得到了object reference not set to instance of object的错误
我该如何解决这个问题。任何帮助将不胜感激。
【问题讨论】:
-
你在哪一行得到这个错误?
-
第二行,投射到
TextObject时 -
您是否检查过HolidaySubReport 是否存在于rDocument.Subreports 中?
-
谢谢你是绝对正确的。问题是我给出了对象名称而不是子报告名称
标签: c# crystal-reports subreport