2010-01-05 56 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

相關問題