乱来一下:
If DataTables("物料采购表").DataCols.Contains("结帐a") = False Then
DataTables("物料采购表").DataCols.Add("结帐a", Gettype(String),8)
End If
For Each r As Row In Tables("物料采购表").rows
If r("结帐") = False
r("结帐a") = "未结帐"
Else
r("结帐a") = "已结帐"
End If
Next
Dim g As New CrossTableBuilder("物料采购统计", DataTables("物料采购表"))
g.HGroups.AddDef("物料收货日期", "月")
g.HGroups.AddDef("供应商")
g.VGroups.AddDef("结帐a")
g.Totals.AddDef("采购数量", "采购数量")
g.Totals.AddDef("物料金额", "物料金额")
g.Subtotal = True
g.Build()
MainTable = Tables("物料采购统计")