Foxtable(狐表)用户栏目专家坐堂 → 表计算BUG反馈


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

主题:表计算BUG反馈

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


加好友 发短信
等级:四尾狐 帖子:977 积分:6806 威望:0 精华:1 注册:2012/8/7 22:03:00
表计算BUG反馈  发帖心情 Post By:2017/6/27 17:36:00 [只看该作者]




第一列为备注型,第二列为双精度小数

备注型中输入以下字符串

600458,,600462,,006396,,017333,,600759,,017141,,600763,,600764,,600765,,006284,,013377,,013376,,013375,,006404,,006791,,006383,,012355,,010524,,010537,,014653,,006392,,006384,,006385,,006386,,006388,,006282,,006281,,017255,

选中第一列和第二列

执行一下代码
Output.Show(CurrentTable.Aggregate(Foxtable.AggregateEnum.Sum, CurrentTable.TopRow, CurrentTable.LeftCol, CurrentTable.BottomRow, CurrentTable.RightCol))


报错

---------------------------
版本:2017.6.12.1
---------------------------
代码执行出错,错误信息:



System.OverflowException: 值对于 Decimal 太大或太小。

   在 System.Decimal..ctor(Double value)

   在 #s5.#6mb.#5mb(Object #Pu)

   在 #s5.#2fb.Aggregate(AggregateEnum #gc, CellRange #Ccb, AggregateFlags #pC)

   在 C1.Win.C1FlexGrid.C1FlexGridBase.Aggregate(AggregateEnum aggType, CellRange rg, AggregateFlags flags)

   在 C1.Win.C1FlexGrid.C1FlexGridBase.Aggregate(AggregateEnum aggType, Int32 topRow, Int32 leftCol, Int32 bottomRow, Int32 rightCol, AggregateFlags flags)

   在 Foxtable.Table.Aggregate(AggregateEnum AggregateType, Int32 R1, Int32 C1, Int32 R2, Int32 C2)

   在 UserCode.Test()
---------------------------
确定   
---------------------------



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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/27 18:59: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


 回到顶部