Foxtable(狐表)用户栏目专家坐堂 → 无法在 System.String 和 System.Int32 上执行“=”操作


  共有88人关注过本帖平板打印复制链接

主题:无法在 System.String 和 System.Int32 上执行“=”操作

帅哥哟,离线,有人找我吗?
hanlingli119
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:10 积分:230 威望:0 精华:0 注册:2019/11/2 16:31:00
无法在 System.String 和 System.Int32 上执行“=”操作  发帖心情 Post By:2024/6/28 15:38:00 [只看该作者]

无法在 System.String 和 System.Int32 上执行“=”操作   如果在位置1和位置2输入数字,没问题,但输入汉字就会出现上述情况,怎么调整,谢谢
首先生成统计表
Dim dt As DataTable
Dim b As New SQLGroupTableBuilder("统计表1", "其它算量")
b.Groups.AddDef("位置1")
b.Groups.AddDef("位置2")
b.Groups.AddDef("名称") 
b.Totals.AddDef("计算值") 
dt = b.Build(False) '参数设置为False,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt, "位置1|位置2|名称")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
    Dim Year As String = nd.DataRow("位置1")
    Dim Month As String = nd.DataRow("位置2")
    Dim Product As String = nd.DataRow("名称")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "(" & dt.Compute("Sum(计算值)", "位置1 = " & Year) & ")"
        Case 1
            nd.Text = nd.text & "(" & dt.Compute("Sum(计算值)", "位置1 = " & Year & " And 位置2 = " & Month) & ")"
        Case 2
            nd.Text = nd.text & "(" & nd.DataRow("计算值") & ")"
    End Select
Next
trv.Nodes.Insert("加载所有行", "加载所有行(" & dt.Compute("Sum(计算值)") & ")", 0)
trv.ResumeRedraw

 回到顶部