代码
For i As Integer = Tables("金工总表").TopPosition To Tables("金工总表").BottomPosition
Dim adr As Row = Tables("金工总表").Rows(i)
If adr.IsNull("路线卡代号") = False Then
For Each adc As DataCol In DataTables("金工总表").DataCols
If adc.Name.StartsWith("工序") AndAlso adr.IsNull(adc.Name) = False Then
Dim bdr As DataRow = DataTables("路线卡明细").AddNew()
bdr("序号") = adr("序号")
bdr("订单号") = adr("订单号")
bdr("路线卡代号") = adr("路线卡代号")
bdr("工序") = adr(adc.Name)
End If
Next
End If
Next
DataTables("路线卡明细").Save()
MainTable = Tables("路线卡明细")