Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:管理项目13.zip |
Dim dtb As New DataTableBuilder("统计表1") |
dtb.AddDef("销档", GetType(String), 16) |
dtb.AddDef("标号", GetType(String), 16) |
dtb.AddDef("产量", GetType(Integer)) |
Dim lst As New List(Of String) |
For Each c As Col In Tables("表A").cols |
If c.Name Like "*_物料_*" Then |
For Each v As String In DataTables("表A").GetValues(c.Name, c.Name & " is not null") |
If lst.Contains(v) = False Then |
lst.Add(v) |
dtb.AddDef(v, GetType(Double)) |
End If |
Next |
End If |
Next |
dtb.Build() |
For Each v As String() In DataTables("表A").GetValues("砼销明细_销档|砼销明细_生产信息_标号") |
Dim dr1 As DataRow = DataTables("统计表1").AddNew() |
dr1("销档") = v(0) |
dr1("标号") = v(1) |
For Each dr2 As DataRow In DataTables("表A").Select("砼销明细_销档 = '" & v(0) & "' and 砼销明细_生产信息_标号 = '" & v(1) & "'") |
dr1("产量") = dr1("产量") + dr2("砼销明细_生产信息_产量") |
For Each c As Col In Tables("表A").cols |
If c.Name Like "*_物料_*" Then |
If dr2.IsNull(c.Name) = False Then |
dr1(dr2(c.Name)) = dr1(dr2(c.Name)) + dr2(c.Name.Replace("物料", "用量")) |
End If |
End If |
Next |
Next |
Next |
MainTable = Tables("统计表1") |