Functions.Execute("BuildGanttTable")
With Tables("窗口2_Table2").Grid
.FocusRect = C1.Win.C1FlexGrid.FocusRectEnum.None '不显示焦点框
.HighLight = C1.Win.C1FlexGrid.HighLightEnum.Never '不高亮显示选定区
.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Cell '每次只显示一个单元格
End With
甘特图中星期,计划数,完成数,如何生成,,具体代码如何写?如下图
此主题相关图片如下:甘特图.jpg
[此贴子已经被作者于2025/1/6 11:11:57编辑过]
Dim tbl As Table = Tables("表A")
Dim StartDate As Date = tbl.Compute("Min(日期)", "日期 IS NOT NULL")
Dim EndDate As Date = tbl.Compute("Max(日期)", "日期 IS NOT NULL")
Dim dt As Date = StartDate
Dim ss() As String = {"星期天", "星期一", "星期2", "星期3", "星期4", "星期5", "星期6"}
Dim Builder As New DataTableBuilder("统计")
Builder.Adddef("项目", GetType(String), 16)
Do
Dim nm As String = dt.Year & "年_" & dt.Month & "月_" & dt.Day & "_" & ss(dt.DayOfWeek)
Builder.Adddef(nm & "_计划", GetType(Integer))
Builder.Adddef(nm & "_完成", GetType(Integer))
dt = dt.Adddays(1)
If dt > Enddate Then
Exit Do
End If
Loop
Tables("窗口2_Table2").DataSource = Builder.buildDataSource
Dim r As Row
For Each a As String In tbl.DataTable.GetValues("项目")
r = Tables("窗口2_Table2").AddNew
r("项目") = a
For Each dr As DataRow In tbl.DataTable.Select("项目='" & a & "'")
dt = dr("日期")
r(dt.Year & "年_" & dt.Month & "月_" & dt.Day & "_" & ss(dt.DayOfWeek)& "_计划") = dr("计划数")
Next
Next