在报表的属性里,打开代码面板,键入以下代码:
public shared Dim _sum as Decimal=0
public Function AddToSum(ByVal quantity as Decimal) as Decimal _sum+=quantity return _sum End Function
然后在文本框字段里输入TextBox.Value =Code.AddToSum(Fields!Quantity.Value)即可。