…… With wb.AddTable("", "Table1")
dim dt as datatable = g.Build(True)
Dim nms() As String
Dim qty As Integer
Dim amt As Double
.Head.AddRow( "对账品名", "库存店名", "数量", "金重", "总重量", "标签价格")
For i As Integer = 0 To dt .DataRows.count - 1
Dim r As DataRow = dt .DataRows(i)
If i > 0 Then
Dim lr As DataRow = dt .DataRows(i - 1)
If r("库存店名") <> lr("库存店名") Then
qty = dt .compute("sum(数量)", "对账品名='" & lr("对账品名") & "' And 库存店名= '" & lr("库存店名") & "'")
……