下面代码交叉表汇总,需要增加一列表达式列来显示效率,代码执行后,效率列没有显示,问题出在哪里?请各位老师指教,谢谢!
Dim rq As Date = RibbonTabs("实时采集")("日期单位").Items("日期").Value
Dim y As Integer = rq.Year
Dim m As Integer = rq.Month
Dim dt1 As New Date(y, m, 1) '月初
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '月底
Dim sql As String = "Select 日期,人员ID,Sum(定额秒时)/3600 as 定额,Sum(实际秒时)/3600 as 实际 FRO M {扎包数据} WHERE 日期 >= '" & dt1 & "' And 日期 <= '" & dt2 & "' Group By 日期,人员ID"
Dim b As New CrossTableBuilder("统计表1",sql,"MES")
b.HGroups.AddDef("人员ID")
b.VGroups.Adddef("日期",DateGroupEnum.Day,"日")
b.Totals.AddDef("定额")
b.Totals.AddDef("实际")
b.Totals.AddExp("效率","定额 / 实际 * 100")
b.HorizontalTotal = True
b.VerticalTotal = True
b.Build()
Tables("统计表1").AutoSizeCols()
MainTable = Tables("统计表1")
此主题相关图片如下:捕获6.png
[此贴子已经被作者于2016/3/2 21:42:22编辑过]