2010-01-05 128 views

回答

2

每CodeByMoonlight评论编辑 - 我没有测试过这还,但它应该是方式比我原来的更好。

ReportDocument reportDocument = new ReportDocument(); 
reportDocument.Load(...); 
foreach (ReportDocument subreportDocument in reportDocument.Subreports) { 
    // do something here 
} 
+0

稍微矫枉过正 - 有保持ReportDocument本身的子报表属性,所以您不必一一列举每一个报表对象,并检查它的子报表。 – MartW 2010-01-05 18:41:14

+0

@moonlight - thanx - 看起来好多了。我的原始代码是我多年来一直使用的代码 - 我想知道Subreports属性是相当新的,还是我第一次错过它... – Ray 2010-01-05 18:56:42

+0

好多了:)我认为它已经存在了一段时间,但我已经没有多少电话使用它。 – MartW 2010-01-06 11:29:31

相关问题