2013-03-15 31 views
0

我能夠通過 shared numbervar sub1Total從子報告中拉出一個字段; 但我需要將它們添加到組的結尾。如果我嘗試在主報告中對該字段進行總結,則會發現該字段不能與總和一起使用的錯誤。我如何總結水晶中的子報告中提取的數據

+0

你所說的「把它們加起來在組結束」的意思是?什麼組?你想要總結什麼?您應該爲問題添加更多細節。 – Ryan 2013-03-15 20:03:35

+0

是的子報表運行線與主報表一致。在主要報告的一個小組結尾,我需要做一筆總和。我不能在子報表中這樣做,因爲它在主報表的每一行重新開始。 – user2022883 2013-03-15 20:14:25

回答

1

您可以通過在主報告中通過全局變量跟蹤它們來追加從子報告傳回的值。

//Initialize the variable in the Group Header of the main report 
whileprintingrecords; 
numbervar groupsub := 0; 

//Update the variable in the Details section of the main report 
whileprintingrecords; 
numbervar groupsub; 
shared numbervar subval; 

groupsub := groupsub + subval; 

//Print the accumulated group value in the Group Footer of the main report 
whileprintingrecords; 
numbervar groupsub; 
0

注:只工作,如果總和

groupsub:= groupsub + subval;

細節部分