以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 根据设备及时间显示内容 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=109981) |
-- 作者:有点甜 -- 发布时间:2017/11/24 9:37:00 -- 参考
http://www.foxtable.com/webhelp/scr/0681.htm
|
-- 作者:有点甜 -- 发布时间:2017/11/24 14:42:00 -- 你各列的日期,列名是如何命名的?要改成这样的,如 20171124 20171125 20171126
Dim dt As DataTable =DataTables("生产排产表")
|
-- 作者:有点甜 -- 发布时间:2017/11/24 15:54:00 -- 1、写代码
Dim dt As DataTable =DataTables("生产排产表")
2、重置列
[此贴子已经被作者于2017/11/24 17:22:10编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/11/24 16:57:00 -- 具体实例上传上来测试。 |
-- 作者:有点蓝 -- 发布时间:2017/11/24 17:12:00 -- If sp.TotalDays >=0 AndAlso sp.TotalDays < 31 Then e.DataRow("日" & sp.TotalDays+1) = dr("成品描述") End If |
-- 作者:有点甜 -- 发布时间:2017/11/24 17:24:00 -- Dim dt As DataTable =DataTables("生产排产表") If e.DataCol.Name = "设备编码" Then Dim drs = dt.Select("使用设备 = \'" & e.DataRow("设备编码") & "\'") For Each dr As DataRow In drs Dim d1 As Date = dr("开始日期") Dim d2 As Date = dr("预计结束日期") For i As Integer = 0 To (d2-d1).TotalDays Dim d As Date = d1.AddDays(i) Dim sp As TimeSpan = d - Date.Today If sp.TotalDays >=0 AndAlso sp.TotalDays < 31 Then e.DataRow("日" & sp.TotalDays+1) = dr("成品描述") End If Next Next End If |