C# 如何浏览Crystal Reports 2008中的子报表集合?
我的报告中有很多子报告 如何浏览主报表中的子报表集合?我需要它来更改每个子报表的数据源C# 如何浏览Crystal Reports 2008中的子报表集合?,c#,crystal-reports,C#,Crystal Reports,我的报告中有很多子报告 如何浏览主报表中的子报表集合?我需要它来更改每个子报表的数据源 TIA根据CodeByMoonlight评论编辑-我还没有测试过这个,但它应该比我的原创版本好得多 ReportDocument reportDocument = new ReportDocument(); reportDocument.Load(...); foreach (ReportDocument subreportDocument in reportDocument.Subreports) {
TIA根据CodeByMoonlight评论编辑-我还没有测试过这个,但它应该比我的原创版本好得多
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(...);
foreach (ReportDocument subreportDocument in reportDocument.Subreports) {
// do something here
}
稍微有些过火-ReportDocument本身有一个SubReports属性,因此您不需要枚举每个报表对象并检查它是否是一个子报表。@moonlight-thanx-看起来好多了。我的原始代码是我多年来一直在使用的-我想知道Subreports属性是否相当新,或者我只是第一次错过了它…好得多:)我想它已经存在了一段时间,但我没有太多的电话使用它。