是的,都是整数列
此主题相关图片如下:微信截图_20230630133712.png
生成目录树节点代码正常显示,如下
Dim dt As DataTable
Dim b As New SQLGroupTableBuilder("统计表1","进项fa piao")
b.C
b.Groups.AddDef("fa piao类型")
b.Groups.AddDef("开piao单位简称")
b.Groups.AddDef("认证年份")
b.Groups.AddDef("认证月份")
b.Groups.AddDef("fa piao日期",DateGroupEnum.Year,"年")
b.Groups.AddDef("fa piao日期",DateGroupEnum.Month,"月")
b.Groups.AddDef("fa piao日期",DateGroupEnum.Day,"日")
b.Totals.AddDef("认证年份",AggregateEnum.Count,"份数") '根据客户列来统计记录数,也就是订单数
dt = b.Build(True) '参数设置为True,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
trv1.BuildTree(dt, "fa piao类型|开piao单位简称|认证年份|认证月份|年|月|日","","fa piao类型,开piao单位简称,认证年份,认证月份,年,月,日")
trv1.StopRedraw
For Each nd As WinForm.TreeNode In trv1.AllNodes
Dim lx As String = nd.DataRow("fa piao类型")
Dim nm As String = nd.DataRow("开piao单位简称")
Dim Y As Integer = nd.DataRow("认证年份")
Dim M As Integer = nd.DataRow("认证月份")
Dim year As Integer = nd.DataRow("年")
Dim month As Integer = nd.DataRow("月")
Dim day As Integer = nd.DataRow("日")
Select Case nd.Level
Case 0
nd.Text = nd.text & "(" & dt.Compute("sum(份数)","fa piao类型 = '" & lx & "'") & "份)"
Case 1
nd.Text = nd.text & "(" & dt.Compute("sum(份数)","fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'") & "份)"
Case 2
nd.Text = nd.text & "(" & dt.Compute("sum(份数)","fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'And 认证年份 = " & y ) & "份)"
Case 3
nd.Text = nd.text & "(" & dt.Compute("sum(份数)","fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'And 认证年份 = " & y & "and 认证月份 = " & m ) & "份)"
Case 4
Dim Filter As String = " fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'and 认证年份 = " & y & "and 认证月份 = " & m & " And 年 = " & year
nd.Text = nd.text & "(" & dt.Compute("sum(份数)",filter) & "份)"
Case 5
Dim Filter As String = "fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'and 认证年份 = " & y & "and 认证月份 = " & m & " And 年 = " & year & " And 月 = " & month
nd.Text = nd.text & "(" & dt.Compute("sum(份数)",filter) & "份)"
Case 6
Dim Filter As String = "fa piao类型 = '" & lx & "'and 开piao单位简称 = '" & nm & "'and 认证年份 = " & y & "and 认证月份 = " & m & " And 年 = " & year & " And 月 = " & month & " and 日 = " & day
nd.Text = nd.text & "(" & dt.Compute("sum(份数)",filter) & "份)"
End Select
Next
trv1.Nodes.Insert("加载所有行","加载所有行(" & dt.Compute("Sum(份数)") & "条)",0)
trv1.ResumeRedraw