DataTables("FCST").DataRows.Clear() Dim wks As List (Of String) = DataTables("Calendar").GetUniqueValues("","Week") For Each r As Row In Tables("DemandTable").Rows For Each wk As String In wks If wk > "" Then If r.IsNull(wk) = False Then Dim dr As DataRow = DataTables("Calendar").Find("Week = '" & wk & "'") Dim dr0 As DataRow = DataTables("FCST").AddNew() dr0("DemandDate") = dr("DemandDate") dr0("StokvisPN") = r("StokvisPN") dr0("CustomerPN") = r("CustomerPN") dr0("CustomerCode") = r("CustomerCode") dr0("PlanQuantity") = r(wk) End If End If Next Next Tables("FCST").Sort = "DemandDate" Tables("DemandTable").Filter = "" DataTables("FCST").Save()
|