以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]临时表如何实现Drewcell功能 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=100161) |
|
-- 作者:2900819580 -- 发布时间:2017/5/5 17:03:00 -- [求助]临时表如何实现Drewcell功能
按照有点蓝老师的做法(如上),无法实现, 周日的样式,应该在那里建立 以下是全局DrawCell 代码 If e.Table.Name = "CQ" Then Dim y As String = Forms("生产出勤管理").Controls("Com年").text Dim m As String = Forms("生产出勤管理").Controls("Com月").text For Each c As Col In e.Table.Cols If c.Name <> "部门" AndAlso c.Name <> "姓名" AndAlso c.Name <> "班次" Then Dim de As Date = "#" & m & "/" & c.Caption & "/" & y & "#" Dim dw As Integer = de.DayOfWeek If dw = 0 Then e.Style = "周日" End If Next End If
|
|
-- 作者:有点蓝 -- 发布时间:2017/5/5 17:09:00 -- 你的临时表是通过什么方式生成的? |
|
-- 作者:2900819580 -- 发布时间:2017/5/5 17:14:00 -- Dim y As WinForm.ComboBox = e.Form.Controls("Com年") Dim m As WinForm.ComboBox = e.Form.Controls("Com月") Dim tb As Table = Tables(e.Form.Name & "_Table1") Dim bm As WinForm.ComboBox = e.Form.Controls("Com部门") bm.ComboList = DataTables("users").GetComboListString("小部门") Dim dt As DataTable = DataTables("出勤汇总") y.ComboList = dt.GetComboListString("年份") m.ComboList = dt.GetComboListString("月份") Dim ds As Integer = Date.DaysInMonth(y.Value,m.Value) Dim dtb As New DataTableBuilder("CQ") dtb.AddDef("部门", Gettype(String), 50) dtb.AddDef("姓名", Gettype(String), 50) dtb.AddDef("班次", Gettype(String), 50) For i As Integer = 1 To ds \' c As Col In Tables("BOM").Cols \' dtb.AddDef(y.Value & "年_" & m.Value & "月_" & i , Gettype(String), 20 ) \'& "|星期" & de.DayOfWeek) dtb.AddDef( i & "日" , Gettype(String), 20 , "" , i) \'& "|星期" & de.DayOfWeek) Next dtb.Build() tb.DataSource = DataTables("CQ") DataTables("CQ").GlobalHandler.DrawCell = True For Each c As Col In tb.Cols If c.Name <> "部门" AndAlso c.Name <> "姓名" AndAlso c.Name <> "班次" Then c.ComboList = DataTables("出勤要求").GetComboListString("出勤情况") End If Next Dim dr As DataRow = DataTables("Users").Find("Name = \'" & _username & "\'") bm.Text = dr("小部门") e.Form.Controls("But生成数据").performclick
|
|
-- 作者:有点蓝 -- 发布时间:2017/5/5 17:18:00 -- 1、 Dim dtb As New DataTableBuilder("CQ") dtb.AddDef("部门", Gettype(String), 50) dtb.AddDef("姓名", Gettype(String), 50) dtb.AddDef("班次", Gettype(String), 50) For i As Integer = 1 To ds \' c As Col In Tables("BOM").Cols \' dtb.AddDef(y.Value & "年_" & m.Value & "月_" & i , Gettype(String), 20 ) \'& "|星期" & de.DayOfWeek) dtb.AddDef( i & "日" , Gettype(String), 20 , "" , i) \'& "|星期" & de.DayOfWeek) Next tb.DataSource = dtb.BuildDataSource 2、 全局DrawCell 代码 If e.Table.Name = "某窗口名称_Table1" Then ...... |
|
-- 作者:2900819580 -- 发布时间:2017/5/5 17:32:00 -- 老师,还是不行, 这个周日的样式应该在那里 增加。 If dw = 0 Then e.Style = "周日"
|
|
-- 作者:有点蓝 -- 发布时间:2017/5/5 17:50:00 -- |
|
-- 作者:2900819580 -- 发布时间:2017/5/5 20:39:00 -- 老师,可能我没有问题清楚,我想问的是要在那个数据表中增加样式, 因为CQ表是临时表,不可以增加样式的。
|
|
-- 作者:有点蓝 -- 发布时间:2017/5/5 20:49:00 -- Dim dtb As New DataTableBuilder("CQ") dtb.AddDef("部门", Gettype(String), 50) dtb.AddDef("姓名", Gettype(String), 50) dtb.AddDef("班次", Gettype(String), 50) For i As Integer = 1 To ds \' c As Col In Tables("BOM").Cols \' dtb.AddDef(y.Value & "年_" & m.Value & "月_" & i , Gettype(String), 20 ) \'& "|星期" & de.DayOfWeek) dtb.AddDef( i & "日" , Gettype(String), 20 , "" , i) \'& "|星期" & de.DayOfWeek) Next tb.DataSource = dtb.BuildDataSource tb.DataTable.AddUserStyle("周日", Color.Red, Color.White)
|
|
-- 作者:2900819580 -- 发布时间:2017/5/6 9:47:00 -- 老师,我只想要周日的列更改样式,其它列不更改。 If e.Table.Name = "生产出勤管理_Table1" Then Dim y As String = Forms("生产出勤管理").Controls("Com年").text Dim m As String = Forms("生产出勤管理").Controls("Com月").text For Each c As Col In e.Table.Cols If c.Name <> "部门" AndAlso c.Name <> "姓名" AndAlso c.Name <> "班次" Then Dim de As Date = "#" & m & "/" & c.Caption & "/" & y & "#" Dim dw As Integer = de.DayOfWeek If dw = 0 Then e.Style = "周日" ‘ End If Next End If |
|
-- 作者:有点蓝 -- 发布时间:2017/5/6 9:59:00 -- 周日是列名? If e.Table.Name = "生产出勤管理_Table1" Then if e.col.name = "周日" then 其它代码 end if End If
|