为什么下列代码执行不完整
If e.DataCol.name = "单位" Then
Dim dr As DataRow = e.DataRow
Dim t As Table = Tables("Xxbb")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "单位"
g.TotalOn = "一年级,二年级,三年级,四年级,五年级,六年级"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
t.Subtotal()
For i As Integer = 0 To Tables("Xxbb").Rows.Count(True) - 1 'Count加上参数True
If Tables("Xxbb").Rows(i,True).IsGroup Then '如果是分组行
If dr("单位") = Tables("Xxbb").Rows(i,True)("单位").SubString(0,4) Then
dr("SYBB") = Tables("Xxbb").Rows(i,True)("一年级")
End If
End If
Next
End If