For Each nd As WinForm.TreeNode In trv.AllNodes Dim Year As Integer = nd.DataRow("年") Dim jidu As Integer = nd.DataRow("季") Dim Month As Integer = nd.DataRow("月") Dim dwmc As String = nd.DataRow("单位名称") Dim zgr As String = nd.DataRow("撰稿人") Select Case nd.Level Case 0 nd.Text = nd.text & "年(" & dt.Compute("Sum(记录数)","年 = " & Year) & "条" & dt.Compute("Sum(奖金)","年 = " & Year) & "元)" Case 1 nd.Text = nd.text & "季(" & dt.Compute("Sum(记录数)","年 = " & Year & " And 季 = " & jidu) & "条" & dt.Compute("Sum(奖金)","年 = " & Year & " And 季 = " & jidu) & "元)" Case 2 nd.Text = nd.text & "月(" & dt.Compute("Sum(记录数)","年 = " & Year & " And 季 = " & jidu & " and 月 = " & Month) & "条" & dt.Compute("Sum(奖金)","年 = " & Year & " And 季 = " & jidu & " And 月 = " & Month) & "元)" Case 3 nd.Text = nd.text & "(" & nd.DataRow("记录数") & "条)" & nd.DataRow("奖金") & "元)" End Select Next
|