以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 表达式问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=124198) |
-- 作者:lfz123 -- 发布时间:2018/9/1 15:11:00 -- 表达式问题 老师请帮我改下有背景表达式错误,我总是会在表达式搞的头晕 Dim dt As DataTable Dim b As New GroupTableBuilder("统计表1",DataTables("入库单")) b.Groups.AddDef("供应商简称") b.Groups.AddDef("入库日期",DateGroupEnum.Year,"年") b.Groups.AddDef("入库日期",DateGroupEnum.Month,"月") b.Totals.AddDef("含税金额",AggregateEnum.Sum,"含税金额") \'根据客户列来统计记录数,也就是订单数 dt = b.Build(True) \'参数设置为True,生成一个临时表,不在主界面显示 Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt,"供应商简称|年|月") trv.StopRedraw For Each nd As WinForm.TreeNode In trv.AllNodes Dim nm As String = nd.DataRow("供应商简称") Dim Year As Integer = nd.DataRow("年") Dim Month As Integer = nd.DataRow("月") Select Case nd.Level Case 0 nd.Text = nd.text & "(¥:" & dt.Compute("Sum(含税金额)","供应商简称 = \'"& nm & "\'") & "元)" Case 1 nd.Text = nd.text & "(¥:" & dt.Compute("Sum(含税金额)","供应商简称 = \'" & nm & "\' & "And 年 = " & year) & "元)" \'Case 2 \'nd.Text = nd.text & "(¥:" & nd.DataRow("订单数") & "元)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(¥:" & dt.Compute("Sum(含税金额)") & "元)",0) trv.ResumeRedraw
|
-- 作者:有点蓝 -- 发布时间:2018/9/1 15:18:00 -- nd.Text = nd.text & "(¥:" & dt.Compute("Sum(含税金额)","供应商简称 = \'" & nm & "\' And 年 = " & year) & "元)" |
-- 作者:lfz123 -- 发布时间:2018/9/1 15:28:00 -- 回复:(有点蓝)nd.Text = nd.text & "(¥:" &am... 老师在帮我看下这个,又加了个条件: 老师能教我怎样理解这个公式吗? nd.Text = nd.text & "(¥:" & dt.Compute("Sum(含税金额)","供应商简称 = \'" & nm & "\' And 年 = " & year And 月 = " & month) & "元)"
|
-- 作者:有点蓝 -- 发布时间:2018/9/1 15:48:00 -- 把【编程基础】这章内容多看看 nd.Text = nd.text & "(¥:" & dt.Compute("Sum(含税金额)","供应商简称 = \'" & nm & "\' And 年 = " & year & " And 月 = " & month) & "元)"
|