以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 状态栏显示数据问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=121786) |
-- 作者:ZJZK2018 -- 发布时间:2018/7/13 2:59:00 -- 状态栏显示数据问题 老师你好: 我在表AfterSelRangeChange事件中写入 \'\'\'在状态栏显示选定区域的数据信息 If Forms("标录明细录入").Opened Then Dim it As Winform.StripItem = e.Form.Strips("状态栏").Items("Stat") it.Text = "" Dim Sum,Count,Average,Max,Min As Double If CurrentTable.Cols(CurrentTable.ColSel).IsNumeric Then \'如果当前列是数值列 With CurrentTable Count = .Aggregate(AggregateEnum.Count, .TopRow, .LeftCol, .BottomRow, .RightCol) Sum = Format(.Aggregate(AggregateEnum.Sum, .TopRow, .LeftCol, .BottomRow, .RightCol),"0.00") Average = Format(.Aggregate(AggregateEnum.Average , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.00") Max = Format(.Aggregate(AggregateEnum.Max , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.00") Min = Format(.Aggregate(AggregateEnum.Min , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.00") End With End If it.Text = "计数:" & Count & "个; 累计:" & Sum & "; 平均值:" & Average & "; 最大值:" & Max & "; 最小值:" & Min \'StatusBar.Message3 = "计数:" & Count & " 累计:" & Sum & " 平均:" & Average End If 出现下面错误提示 .NET Framework 版本:2.0.50727.8762 Foxtable 版本:2018.7.9.1 错误所在事件:标录明细,AfterSelRangeChange 详细错误信息: 未将对象引用设置到对象的实例。 |
-- 作者:有点甜 -- 发布时间:2018/7/13 9:05:00 -- Dim it As Winform.StripItem = Forms("标录明细录入").Strips("状态栏").Items("Stat") |
-- 作者:ZJZK2018 -- 发布时间:2018/7/17 14:30:00 -- 老师你好: 我格式化时,加了%出错了,如何调整?谢谢 \'\'\'\'在状态栏显示选定区域的数据信息 If Forms("标录明细录入").Opened Then Dim it As Winform.StripItem = Forms("标录明细录入").Strips("状态栏").Items("Stat") it.Text = "" Dim Sum,Count,Average,Max,Min,Average1 As Double With CurrentTable Count = .Aggregate(AggregateEnum.Count, .TopRow, .LeftCol, .BottomRow, .RightCol) Sum = Format(.Aggregate(AggregateEnum.Sum, .TopRow, .LeftCol, .BottomRow, .RightCol),"0.0000") \'Average = Format(.Aggregate(AggregateEnum.Average , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.0000") Average1 = .Aggregate(AggregateEnum.Average , .TopRow, .LeftCol, .BottomRow, .RightCol) Average = IIF(Average1 < 1,Format(Average1,"00.00%"),Format(Average1,"0.00")) Max = Format(.Aggregate(AggregateEnum.Max , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.000") Min = Format(.Aggregate(AggregateEnum.Min , .TopRow, .LeftCol, .BottomRow, .RightCol),"0.0000") End With it.Text = "计数:" & Count & "个; 累计:" & Sum & "; 平均值:" & Average & "; 最大值:" & Max & "; 最小值:" & Min End If
|
-- 作者:有点蓝 -- 发布时间:2018/7/17 16:31:00 -- 提示什么错误? |
-- 作者:ZJZK2018 -- 发布时间:2018/7/17 16:45:00 -- 提示错误: .NET Framework 版本:2.0.50727.8762 Foxtable 版本:2018.7.9.1 错误所在事件:标录明细,AfterSelRangeChange 详细错误信息: 从字符串“00.00%”到类型“Double”的转换无效。 输入字符串的格式不正确。 |
-- 作者:有点甜 -- 发布时间:2018/7/17 19:18:00 -- 你的Average要定义成字符串类型,如
Dim Average As String |