Dim t As Table = Tables("Shipment.customsinvoice")
Dim cr = t.Rows(t.BottomPosition )
Dim Total As Double = cr("Netweight_Total")
For i As Integer = t.BottomPosition-1 To t.TopPosition Step -1
If cr("ShippingNO") = t.Rows(i)("ShippingNO") AndAlso cr("NameinChinese") = t.Rows(i)("NameinChinese") AndAlso cr("Unit") = t.Rows(i)("unit") AndAlso cr("HS") = t.Rows(i)("HS")
cr("Qty") += val(t.Rows(i)("Qty"))
cr("TotalPrice") += val(t.Rows(i)("TotalPrice"))
cr("PO_UnitPrice") += val(t.Rows(i)("TotalPrice"))/val(t.Rows(i)("Qty"))
cr("GrossWeight_total") += val(t.Rows(i)("GrossWeight_Total"))
Total += val(t.Rows(i)("Netweight_Total"))
cr("Netweight_PC") = Total /cr("Qty")
t.Rows(i).delete
Else
cr = t.Rows(i)
End If
Next