Foxtable(狐表)用户栏目专家坐堂 → [求助]状态栏统计出错


  共有1701人关注过本帖树形打印复制链接

主题:[求助]状态栏统计出错

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


加好友 发短信
等级:小狐 帖子:373 积分:2732 威望:0 精华:0 注册:2012/2/17 20:05:00
[求助]状态栏统计出错  发帖心情 Post By:2016/3/23 22:12:00 [只看该作者]

我在项目SystemIdle中写了如下代码Dim str1 As String = ""
Dim t As Table = CurrentTable
Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
RibbonMenu.StatusBar.Message3 = Str1
只有一列选中后会出现这种错误,这列是字符型16的列

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

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/3/23 22:15:00 [只看该作者]

 你是不是计算了字符串列?

 

http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=82211&skin=0

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
WUZHAN
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:373 积分:2732 威望:0 精华:0 注册:2012/2/17 20:05:00
  发帖心情 Post By:2016/3/23 22:30:00 [只看该作者]

Dim str1 As String = ""
Dim t As Table = CurrentTable
Dim hadString As Boolean = False
For i As Integer = t.LeftCol To t.RightCol
    If t.cols(i).IsString Then
        hadString = True
        Exit For
    End If
Next
Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
If hadString = False Then
    Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If

StatusBar.Message3 = str1

这段代码会出错,我想如是字符列,就只统计 计数,不统计 累计和平均

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/3/23 23:58:00 [只看该作者]

这段代码,没有问题啊

 回到顶部