2013-07-22 42 views
0

我有一個活動報告,其中有兩列名爲Deposit and Withdrawal。我想要獲得活動報告最後一頁的兩列總和。我在ReportStart事件做了一些代碼如何在活動報告的最後一頁獲得列的總和

var fldDepositTotal = ar.Sections["gfDetail"].Controls["fldDepositTotal"] as DataDynamics.ActiveReports.TextBox; 
var fldWithdrawalTotal = ar.Sections["gfDetail"].Controls["fldWithdrawalTotal"] as DataDynamics.ActiveReports.TextBox; 

      fldDepositTotal.DataField = "AmountD"; // Your datafield value 
      fldDepositTotal.SummaryFunc = SummaryFunc.Sum; 
      fldDepositTotal.SummaryGroup = "ghDetail"; 
      fldDepositTotal.SummaryRunning = SummaryRunning.Group; 
      fldDepositTotal.SummaryType = SummaryType.GrandTotal; 


      fldWithdrawalTotal.DataField = "AmountW"; // Your datafield value 
      fldWithdrawalTotal.SummaryFunc = SummaryFunc.Sum; 
      fldWithdrawalTotal.SummaryGroup = "ghDetail"; 
      fldWithdrawalTotal.SummaryRunning = SummaryRunning.Group; 
      fldWithdrawalTotal.SummaryType = SummaryType.GrandTotal; 

我必須讓它在報告頁腳也不過的存款和取款金額仍然沒有得到總和。我怎樣才能得到列的總和?

回答

1

SummaryRunning setting基本上定義何時將重新設置累計總數爲零。如果報告級的總價值不高,您不希望重置價值 - 您希望它在整個報告中繼續累積。所以你不需要這裏的SummaryGroupSummaryRunning屬性。因此,根據the SummaryType property's documentation中的示例,您可以按如下方式設置SummaryGroup和SummaryRunning屬性:

fldDepositTotal.DataField = "AmountD"; 
fldDepositTotal.SummaryFunc = SummaryFunc.Sum; 
fldDepositTotal.SummaryGroup = null; 
fldDepositTotal.SummaryRunning = SummaryRunning.None; 
fldDepositTotal.SummaryType = SummaryType.GrandTotal; 
相關問題