以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  移除的行在继续操作时怎么恢复?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=127902)

--  作者:kljbdjz
--  发布时间:2018/11/24 16:18:00
--  移除的行在继续操作时怎么恢复?

图片点击可在新窗口打开查看此主题相关图片如下:11.png
图片点击可在新窗口打开查看

如上图,目前是日期发生变化时,会显示当天的数据,同时询盘等于0的行会自动移除,但是出现了一个问题。
当我更改日期后,会在已经执行过移除行的表中,继续执行询盘等于0时移除行的操作,这样就会造成行越来越少。
怎么在更改日期后,先还原正常的表后,再去执行询盘等于0时移除行?


--  作者:有点蓝
--  发布时间:2018/11/24 16:26:00
--  
更改日期前,重新加载表数据:http://www.foxtable.com/webhelp/scr/1928.htm
--  作者:kljbdjz
--  发布时间:2018/11/24 16:52:00
--  日期的事件没有值改变前执行

图片点击可在新窗口打开查看此主题相关图片如下:22.png
图片点击可在新窗口打开查看


日期的事件没有值改变前执行,只有值改变后执行,

--  作者:有点蓝
--  发布时间:2018/11/24 17:09:00
--  
加载的操作放到您valuechanged原来的代码之前即可
--  作者:kljbdjz
--  发布时间:2018/11/24 17:13:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:22.png
图片点击可在新窗口打开查看


还是不行,操作是否正确?

--  作者:有点蓝
--  发布时间:2018/11/24 17:27:00
--  
这个事件完整代码贴出来
--  作者:kljbdjz
--  发布时间:2018/11/25 9:27:00
--  
Dim tbx As WinForm.DateTimePicker = e.Form.Controls("日期") \'定义输入的文本变量
Dim str As Date = tbx.Value

Dim wek As WinForm.TextBox = e.Form.Controls("TextBox1")
wek.Value = Format(str, "dddd") \'定义星期几

Dim st() As String = {"百度竞价","百度信息流","360竞价","搜狗竞价","神马竞价","朋友圈","小视频","360信息流", "广点通","众盟", "公众微信","淘宝","株洲在线","保驾护航","信用家","自然搜索","置换","其它", "合计"}
Dim dqz As String() = {"株洲","湘潭","衡阳","长沙"}
For Each dq As String In dqz
    For i1 As Integer = 0 To Tables("每日播报表_" & dq & "").Rows.Count - 1
        If st(i1) = "合计"  Then
            Tables("每日播报表_" & dq & "").Rows(i1)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第七列") = DataTables("" & dq & "消费表").Compute("sum(合计_消费)","[日期] = \'" & str & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第八列") = DataTables("" & dq & "消费表").Compute("sum(合计_点击)","[日期] = \'" & str & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第九列") = DataTables("" & dq & "消费表").Compute("sum(合计_展现)","[日期] = \'" & str & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第十列") = DataTables("" & dq & "消费表").Compute("sum(合计_均点价)","[日期] = \'" & str & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("点击率") = DataTables("" & dq & "消费表").Compute("sum(合计_点击率)","[日期] = \'" & str & "\'")
        Else
            Tables("每日播报表_" & dq & "").Rows(i1)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'" & st(i1) & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'" & st(i1) & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'" & st(i1) & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'" & st(i1) & "\' and [地区] = \'" & dq & "\'")
            Tables("每日播报表_" & dq & "").Rows(i1)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'" & st(i1) & "\' and [地区] = \'" & dq & "\'")
            If st(i1) = "360竞价"  Then
                Tables("每日播报表_" & dq & "").Rows(i1)("第七列") = DataTables("" & dq & "消费表").Compute("sum(点睛竞价_消费)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第八列") = DataTables("" & dq & "消费表").Compute("sum(点睛竞价_点击)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第九列") = DataTables("" & dq & "消费表").Compute("sum(点睛竞价_展现)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第十列") = DataTables("" & dq & "消费表").Compute("sum(点睛竞价_均点价)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("点击率") = DataTables("" & dq & "消费表").Compute("sum(点睛竞价_点击率)","[日期] = \'" & str & "\'")
            Else If st(i1) = "360信息流"  Then
                Tables("每日播报表_" & dq & "").Rows(i1)("第七列") = DataTables("" & dq & "消费表").Compute("sum(点睛信息流_消费)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第八列") = DataTables("" & dq & "消费表").Compute("sum(点睛信息流_点击)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第九列") = DataTables("" & dq & "消费表").Compute("sum(点睛信息流_展现)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第十列") = DataTables("" & dq & "消费表").Compute("sum(点睛信息流_均点价)","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("点击率") = DataTables("" & dq & "消费表").Compute("sum(点睛信息流_点击率)","[日期] = \'" & str & "\'")
            Else If st(i1) <> "公众微信" And st(i1) <> "淘宝" And st(i1) <> "自然搜索" And st(i1) <> "置换" And st(i1) <> "其它" And st(i1) <> "株洲在线" And st(i1) <> "保驾护航" And st(i1) <> "信用家"  Then
                Tables("每日播报表_" & dq & "").Rows(i1)("第七列") = DataTables("" & dq & "消费表").Compute("sum([" & st(i1) & "_消费])","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第八列") = DataTables("" & dq & "消费表").Compute("sum([" & st(i1) & "_点击])","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第九列") = DataTables("" & dq & "消费表").Compute("sum([" & st(i1) & "_展现])","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("第十列") = DataTables("" & dq & "消费表").Compute("sum([" & st(i1) & "_均点价])","[日期] = \'" & str & "\'")
                Tables("每日播报表_" & dq & "").Rows(i1)("点击率") = DataTables("" & dq & "消费表").Compute("sum([" & st(i1) & "_点击率])","[日期] = \'" & str & "\'")
           End If
        End If
    Next

\'删除询盘为0及消费为0的行
Dim drs As List(Of DataRow)
drs = DataTables("每日播报表_" & dq & "").Select("[第二列] = 0 And [第七列] Is Null")
For Each dr As DataRow In drs
    dr.Remove
Next

Next



Tables("每日播报表_合计").Rows(0)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'百度竞价\' ")
Tables("每日播报表_合计").Rows(0)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'百度竞价\' ")
Tables("每日播报表_合计").Rows(0)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'百度竞价\' ")
Tables("每日播报表_合计").Rows(0)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'百度竞价\' ")
Tables("每日播报表_合计").Rows(0)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'百度竞价\' ")
Tables("每日播报表_合计").Rows(0)("第七列") = DataTables("株洲消费表").Compute("sum(百度竞价_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度竞价_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度竞价_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度竞价_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(0)("第八列") = DataTables("株洲消费表").Compute("sum(百度竞价_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度竞价_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度竞价_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度竞价_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(0)("第九列") = DataTables("株洲消费表").Compute("sum(百度竞价_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度竞价_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度竞价_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度竞价_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(1)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'百度信息流\' ")
Tables("每日播报表_合计").Rows(1)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'百度信息流\' ")
Tables("每日播报表_合计").Rows(1)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'百度信息流\' ")
Tables("每日播报表_合计").Rows(1)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'百度信息流\' ")
Tables("每日播报表_合计").Rows(1)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'百度信息流\' ")
Tables("每日播报表_合计").Rows(1)("第七列") = DataTables("株洲消费表").Compute("sum(百度信息流_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度信息流_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度信息流_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度信息流_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(1)("第八列") = DataTables("株洲消费表").Compute("sum(百度信息流_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度信息流_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度信息流_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度信息流_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(1)("第九列") = DataTables("株洲消费表").Compute("sum(百度信息流_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(百度信息流_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(百度信息流_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(百度信息流_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(2)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'360竞价\' ")
Tables("每日播报表_合计").Rows(2)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'360竞价\' ")
Tables("每日播报表_合计").Rows(2)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'360竞价\' ")
Tables("每日播报表_合计").Rows(2)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'360竞价\' ")
Tables("每日播报表_合计").Rows(2)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'360竞价\' ")
Tables("每日播报表_合计").Rows(2)("第七列") = DataTables("株洲消费表").Compute("sum(点睛竞价_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛竞价_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛竞价_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛竞价_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(2)("第八列") = DataTables("株洲消费表").Compute("sum(点睛竞价_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛竞价_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛竞价_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛竞价_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(2)("第九列") = DataTables("株洲消费表").Compute("sum(点睛竞价_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛竞价_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛竞价_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛竞价_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(3)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'搜狗竞价\' ")
Tables("每日播报表_合计").Rows(3)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'搜狗竞价\' ")
Tables("每日播报表_合计").Rows(3)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'搜狗竞价\' ")
Tables("每日播报表_合计").Rows(3)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'搜狗竞价\' ")
Tables("每日播报表_合计").Rows(3)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'搜狗竞价\' ")
Tables("每日播报表_合计").Rows(3)("第七列") = DataTables("株洲消费表").Compute("sum(搜狗竞价_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(搜狗竞价_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(搜狗竞价_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(搜狗竞价_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(3)("第八列") = DataTables("株洲消费表").Compute("sum(搜狗竞价_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(搜狗竞价_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(搜狗竞价_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(搜狗竞价_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(3)("第九列") = DataTables("株洲消费表").Compute("sum(搜狗竞价_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(搜狗竞价_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(搜狗竞价_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(搜狗竞价_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(4)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'神马竞价\' ")
Tables("每日播报表_合计").Rows(4)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'神马竞价\' ")
Tables("每日播报表_合计").Rows(4)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'神马竞价\' ")
Tables("每日播报表_合计").Rows(4)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'神马竞价\' ")
Tables("每日播报表_合计").Rows(4)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'神马竞价\' ")
Tables("每日播报表_合计").Rows(4)("第七列") = DataTables("株洲消费表").Compute("sum(神马竞价_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(神马竞价_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(神马竞价_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(神马竞价_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(4)("第八列") = DataTables("株洲消费表").Compute("sum(神马竞价_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(神马竞价_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(神马竞价_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(神马竞价_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(4)("第九列") = DataTables("株洲消费表").Compute("sum(神马竞价_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(神马竞价_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(神马竞价_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(神马竞价_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(5)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'朋友圈\' ")
Tables("每日播报表_合计").Rows(5)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'朋友圈\' ")
Tables("每日播报表_合计").Rows(5)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'朋友圈\' ")
Tables("每日播报表_合计").Rows(5)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'朋友圈\' ")
Tables("每日播报表_合计").Rows(5)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'朋友圈\' ")
Tables("每日播报表_合计").Rows(5)("第七列") = DataTables("株洲消费表").Compute("sum(朋友圈_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(朋友圈_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(朋友圈_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(朋友圈_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(5)("第八列") = DataTables("株洲消费表").Compute("sum(朋友圈_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(朋友圈_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(朋友圈_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(朋友圈_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(5)("第九列") = DataTables("株洲消费表").Compute("sum(朋友圈_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(朋友圈_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(朋友圈_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(朋友圈_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(6)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'小视频\' ")
Tables("每日播报表_合计").Rows(6)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'小视频\' ")
Tables("每日播报表_合计").Rows(6)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'小视频\' ")
Tables("每日播报表_合计").Rows(6)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'小视频\' ")
Tables("每日播报表_合计").Rows(6)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'小视频\' ")
Tables("每日播报表_合计").Rows(6)("第七列") = DataTables("株洲消费表").Compute("sum(小视频_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(小视频_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(小视频_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(小视频_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(6)("第八列") = DataTables("株洲消费表").Compute("sum(小视频_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(小视频_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(小视频_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(小视频_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(6)("第九列") = DataTables("株洲消费表").Compute("sum(小视频_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(小视频_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(小视频_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(小视频_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(7)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'360信息流\' ")
Tables("每日播报表_合计").Rows(7)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'360信息流\' ")
Tables("每日播报表_合计").Rows(7)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'360信息流\' ")
Tables("每日播报表_合计").Rows(7)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'360信息流\' ")
Tables("每日播报表_合计").Rows(7)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'360信息流\' ")
Tables("每日播报表_合计").Rows(7)("第七列") = DataTables("株洲消费表").Compute("sum(点睛信息流_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛信息流_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛信息流_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛信息流_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(7)("第八列") = DataTables("株洲消费表").Compute("sum(点睛信息流_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛信息流_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛信息流_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛信息流_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(7)("第九列") = DataTables("株洲消费表").Compute("sum(点睛信息流_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(点睛信息流_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(点睛信息流_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(点睛信息流_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(8)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'广点通\' ")
Tables("每日播报表_合计").Rows(8)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'广点通\' ")
Tables("每日播报表_合计").Rows(8)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'广点通\' ")
Tables("每日播报表_合计").Rows(8)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'广点通\' ")
Tables("每日播报表_合计").Rows(8)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'广点通\' ")
Tables("每日播报表_合计").Rows(8)("第七列") = DataTables("株洲消费表").Compute("sum(广点通_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(广点通_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(广点通_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(广点通_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(8)("第八列") = DataTables("株洲消费表").Compute("sum(广点通_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(广点通_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(广点通_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(广点通_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(8)("第九列") = DataTables("株洲消费表").Compute("sum(广点通_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(广点通_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(广点通_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(广点通_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(9)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'众盟\' ")
Tables("每日播报表_合计").Rows(9)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'众盟\' ")
Tables("每日播报表_合计").Rows(9)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'众盟\' ")
Tables("每日播报表_合计").Rows(9)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'众盟\' ")
Tables("每日播报表_合计").Rows(9)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'众盟\' ")
Tables("每日播报表_合计").Rows(9)("第七列") = DataTables("株洲消费表").Compute("sum(众盟_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(众盟_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(众盟_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(众盟_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(9)("第八列") = DataTables("株洲消费表").Compute("sum(众盟_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(众盟_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(众盟_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(众盟_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(9)("第九列") = DataTables("株洲消费表").Compute("sum(众盟_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(众盟_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(众盟_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(众盟_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(10)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'公众微信\' ")
Tables("每日播报表_合计").Rows(10)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'公众微信\' ")
Tables("每日播报表_合计").Rows(10)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'公众微信\' ")
Tables("每日播报表_合计").Rows(10)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'公众微信\' ")
Tables("每日播报表_合计").Rows(10)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'公众微信\' ")

Tables("每日播报表_合计").Rows(11)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'淘宝\' ")
Tables("每日播报表_合计").Rows(11)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'淘宝\' ")
Tables("每日播报表_合计").Rows(11)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'淘宝\' ")
Tables("每日播报表_合计").Rows(11)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'淘宝\' ")
Tables("每日播报表_合计").Rows(11)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'淘宝\' ")
Tables("每日播报表_合计").Rows(11)("第七列") = DataTables("株洲消费表").Compute("sum(淘宝_消费)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(淘宝_消费)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(淘宝_消费)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(淘宝_消费)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(11)("第八列") = DataTables("株洲消费表").Compute("sum(淘宝_点击)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(淘宝_点击)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(淘宝_点击)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(淘宝_点击)","[日期] = \'" & str & "\'") 
Tables("每日播报表_合计").Rows(11)("第九列") = DataTables("株洲消费表").Compute("sum(淘宝_展现)","[日期] = \'" & str & "\'") + DataTables("湘潭消费表").Compute("sum(淘宝_展现)","[日期] = \'" & str & "\'") + DataTables("衡阳消费表").Compute("sum(淘宝_展现)","[日期] = \'" & str & "\'") + DataTables("长沙消费表").Compute("sum(淘宝_展现)","[日期] = \'" & str & "\'") 

Tables("每日播报表_合计").Rows(12)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'株洲在线\' ")
Tables("每日播报表_合计").Rows(12)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'株洲在线\' ")
Tables("每日播报表_合计").Rows(12)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'株洲在线\' ")
Tables("每日播报表_合计").Rows(12)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'株洲在线\' ")
Tables("每日播报表_合计").Rows(12)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'株洲在线\' ")

Tables("每日播报表_合计").Rows(13)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'保驾护航\' ")
Tables("每日播报表_合计").Rows(13)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'保驾护航\' ")
Tables("每日播报表_合计").Rows(13)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'保驾护航\' ")
Tables("每日播报表_合计").Rows(13)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'保驾护航\' ")
Tables("每日播报表_合计").Rows(13)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'保驾护航\' ")

Tables("每日播报表_合计").Rows(14)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'信用家\' ")
Tables("每日播报表_合计").Rows(14)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'信用家\' ")
Tables("每日播报表_合计").Rows(14)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'信用家\' ")
Tables("每日播报表_合计").Rows(14)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'信用家\' ")
Tables("每日播报表_合计").Rows(14)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'信用家\' ")

Tables("每日播报表_合计").Rows(15)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'自然搜索\' ")
Tables("每日播报表_合计").Rows(15)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'自然搜索\' ")
Tables("每日播报表_合计").Rows(15)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'自然搜索\' ")
Tables("每日播报表_合计").Rows(15)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'自然搜索\' ")
Tables("每日播报表_合计").Rows(15)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'自然搜索\' ")

Tables("每日播报表_合计").Rows(16)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'置换\' ")
Tables("每日播报表_合计").Rows(16)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'置换\' ")
Tables("每日播报表_合计").Rows(16)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'置换\' ")
Tables("每日播报表_合计").Rows(16)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'置换\' ")
Tables("每日播报表_合计").Rows(16)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'置换\' ")

Tables("每日播报表_合计").Rows(17)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'其它\' ")
Tables("每日播报表_合计").Rows(17)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\' and [询盘来源] = \'其它\' ")
Tables("每日播报表_合计").Rows(17)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\' and [询盘来源] = \'其它\' ")
Tables("每日播报表_合计").Rows(17)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\' and [询盘来源] = \'其它\' ")
Tables("每日播报表_合计").Rows(17)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\' and [询盘来源] = \'其它\' ")

Tables("每日播报表_合计").Rows(18)("第二列") = DataTables("询盘表").Compute("count(编号)","[询盘时间] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第三列") = DataTables("留档表").Compute("count(编号)","[询盘时间] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第四列") = DataTables("上门表").Compute("count(编号)","[上门日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第五列") = DataTables("交定表").Compute("count(编号)","[交定日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第六列") = DataTables("施工表").Compute("count(编号)","[施工日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第七列") = DataTables("各地区消费总表").Compute("sum(合计_消费)","[日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第八列") = DataTables("各地区消费总表").Compute("sum(合计_点击)","[日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第九列") = DataTables("各地区消费总表").Compute("sum(合计_展现)","[日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("第十列") = DataTables("各地区消费总表").Compute("sum(合计_均点价)","[日期] = \'" & str & "\'")
Tables("每日播报表_合计").Rows(18)("点击率") = DataTables("各地区消费总表").Compute("sum(合计_点击率)","[日期] = \'" & str & "\'")




还有一个加载窗口后执行的事件:
Dim dqz As String() = {"株洲","湘潭","衡阳","长沙","合计"}
For Each dq As String In dqz
    
    Dim ss() As String = {"平台","询盘","有效","上门","交定","施工","消费","点击","展现","均点价","点击率"}
    For i As Integer = 0 To Tables("每日播报表_" & dq & "").Cols.Count - 1
        Tables("每日播报表_" & dq & "").Cols(i).Caption = ss(i)
    Next
    
    DataTables("每日播报表_" & dq & "").DataCols.Add("点击率", Gettype(Double))
    DataTables("每日播报表_" & dq & "").DataCols("点击率").SetFormat("0.00%")


    
    
    Tables("每日播报表_" & dq & "").Rows.AddNew(9)
    Dim dr As DataRow
    Dim st() As String = {"百度竞价","百度信息流","360竞价","搜狗竞价","神马竞价","朋友圈","小视频", "360信息流", "广点通", "众盟", "公众微信","淘宝","株洲在线","保驾护航","信用家","自然搜索","置换","其它","合计"}
    For i1 As Integer = 0 To st.Length -1
        dr = DataTables("每日播报表_" & dq & "").DataRows(i1)
        dr("第一列") = st(i1)
    Next
    
    DataTables("每日播报表_" & dq & "").Save
   
    For Each z As Col In Tables("每日播报表_" & dq & "").Cols
        Tables("每日播报表_" & dq & "").AutoSizeCol(z.Name)
        Tables("每日播报表_" & dq & "").Cols("第七列").Width = 60
        Tables("每日播报表_" & dq & "").Cols("第九列").Width = 60
    Next
    
    Dim iq As Byte = 0
    Do While iq <= Tables("每日播报表_" & dq & "").Cols.Count - 1
        Tables("每日播报表_" & dq & "").Cols(iq).TextAlign = TextAlignEnum.Center
        iq = iq + 1
    Loop 

    Tables("每日播报表_" & dq & "").DefaultRowHeight = 30
Next

    Dim rq As WinForm.DateTimePicker = e.Form.Controls("日期")
    rq.Value = Date.Today.AddDays(-1)  \'默认显示昨天日期
[此贴子已经被作者于2018/11/25 9:37:02编辑过]

--  作者:有点甜
--  发布时间:2018/11/25 17:09:00
--  

1、你可以把remove的代码,写到最后去,不要写在最前面;

 

2、你也可以把remove改成filter,筛选掉不符合的内容,而不是移除。


--  作者:kljbdjz
--  发布时间:2018/11/27 16:37:00
--  
感谢大神,用筛选的方法解决了!