以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  不显示某列没有文字的  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=74084)

--  作者:yangwenghd
--  发布时间:2015/9/1 21:43:00
--  不显示某列没有文字的
Dim dd As Date = e.Form.Controls("DateTimePicker2").Value 
Dim y As Integer = dd.Year
Dim w As Integer = dd.DayOfWeek \'算出今天是星期几
Dim dt1 As Date = dd.AddDays(-w) \'获取本周的第一天
Dim dt2 As Date = dd.AddDays(6 - w) \'获取本周的最后一天
Dim Filter As String
Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
Tables("计划表窗口_Table8").Filter = Filter

兄弟们 能帮忙看看吗? 如果在加一个功能  不显示表A “学习科目” 没有内容的 感谢 感谢 

--  作者:yan2006l
--  发布时间:2015/9/1 23:20:00
--  
Dim dd As Date = e.Form.Controls("DateTimePicker2").Value 
Dim y As Integer = dd.Year
Dim w As Integer = dd.DayOfWeek \'算出今天是星期几
Dim dt1 As Date = dd.AddDays(-w) \'获取本周的第一天
Dim dt2 As Date = dd.AddDays(6 - w) \'获取本周的最后一天
Dim Filter As String
Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
filter = filter & " and 学习科目 is not null "
Tables("计划表窗口_Table8").Filter = Filter

--  作者:yangwenghd
--  发布时间:2015/9/4 14:53:00
--  
如果是在上一周的里面加入不显示表A “学习科目” 没有内容的 感谢 感谢 
Dim s As String = e.Form.Controls("Label13").Text
Dim t1 As Table = e.Form.Controls("Table8").Table
Select s
    Case "本周计划"
        s = "上周计划"
        t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 7))
    Case "上周计划"
        s = "第" & Format(DatePart("ww",Date.Today.AddDays(- 14)),"00") & "周计划"
        t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 14))
    Case "下周计划"
        s = "本周计划"
        t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today)
    Case Else
        Dim i As String = s.SubString(s.IndexOf("第") + 1,s.IndexOf("周") - s.IndexOf("第") - 1)
        If Val(i) = DatePart("ww",Date.Today) + 1 Then
            s = "本周计划"
            t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today)
        ElseIf Val(i) = DatePart("ww",Date.Today) + 2 Then
            s = "下周计划"
            t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(7))
        Else
            Dim temp As Integer = val(i-1)
            If temp = 0 Then
                vars("year") -= 1
                temp = t1.DataTable.compute("max(sys_weekofyear)", "年份 = \'" & vars("year") & "\'")
            End If
            s = s.Replace(i,Format(temp,"00"))
            t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & temp
        End If
End Select
e.Form.Controls("Label13").Text = s

感谢 感谢 

--  作者:大红袍
--  发布时间:2015/9/4 14:55:00
--  

 

t1.Filter = "年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 7))

 

改成

 

t1.Filter = "学习科目 is not null  and 年份 = \'" & vars("year") & "\'And sys_weekofyear = " & DatePart("ww",Date.Today.AddDays(- 7))