Dim g As New CrossTableBuilder("统计表1", DataTables("出库明细"))
g.HGroups.AddDef("出库编号")
g.VGroups.AddDef("展柜名称")
g.Totals.AddDef("出库_数量", "出库_数量")
g.OrderByTotal = True
g.HorizontalTotal = True
g.VerticalTotal = True
g.Subtotal = True
g.Build()
MainTable = Tables("统计表1")
DataTables("统计表1").datacols.add("客户姓名",Gettype(String),32)
DataTables("统计表1").datacols.add("收货地址",Gettype(String),64)
DataTables("统计表1").datacols.add("发货日期",Gettype(String),32)
DataTables("统计表1").datacols.add("物流费用",Gettype(String),32)
Dim dt As DataTable = DataTables("出库主表")
Dim dr As DataRow
For Each r As Row In Tables("统计表1").rows
dr = dt.find("配发编号='" & r("出库编号") & "'")
r("客户姓名") = dr("客户姓名")
r("收货地址") = dr("收货地址")
r("发货日期") = dr("发货日期")
r("物流费用") = dr("物流费用")
Next
Forms("返回").OpenTo("统计表1")
Forms("返回").Controls("TextBox1").Value = "提示: ."
MainTable.Focus()
w