以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 项目需求 (http://foxtable.com/bbs/list.asp?boardid=6) ---- 关于自动增加列 (http://foxtable.com/bbs/dispbbs.asp?boardid=6&id=149024) |
-- 作者:季朝龙 -- 发布时间:2020/4/21 16:34:00 -- 关于自动增加列 在DataColChanged事件里编写了如下代码,还是无法实现自动增加列,请老师帮忙看看代码哪里写错了! Select Case e.DataCol.Name Case "预计完工日期" Dim tbl1 As DataTable = DataTables("生产计划_订单表") Dim EndDate1 As Date = tbl1.SQLCompute("Max(预计完工日期)") If e.NewValue > EndDate1 Then Dim dt As Date = EndDate1 Do Dim nm As String = "甘特图" & dt.Year & "年" & dt.Month & "月_" & dt.Day + 1 Dim Builder As New ADOXBuilder Builder.Open() \'打开ADOXBuilder With Builder.Tables("生产计划_订单表甘特图") .AddColumn(nm,ADOXType.String,16) End With Builder.Close() dt = dt.Adddays(1) If dt > e.NewValue Then Exit Do End If Loop For Each cl As Col In Tables("生产计划_订单表甘特图").Cols cl.width = 20 Next For Each dd As DataTable In DataTables dd.Save() Next End If End Select |