我希望把垂直及水平的汇总列放在左面及上面?并且我如何筛选出每月的最大数量的前10项,是按照每月的停机时间按照设备编号的汇总保留最大的前10项?
Dim Filter1 As
String
Filter1 = "[填表日期] > #01-01-2018# And [填表日期] < #12-31-2019# and [应急维修] = true and
设备编号 is not null"
DataTables("维修工作记录").LoadFilter = Filter1
DataTables("维修工作记录").Load
Dim g As New CrossTableBuilder("统计表1",
DataTables("维修工作记录"))
g.HGroups.AddDef("设备编号")
g.VGroups.AddDef("填表日期",
DateGroupEnum.Year, "年")
g.VGroups.AddDef("填表日期",
"{0}月")
g.Totals.AddDef("停机时间",
"停机时间")
g.OrderByTotal =
True
g.HorizontalTotal =
True
g.VerticalTotal =
True
g.Subtotal = True
g.Build()
Dim t As Table = Tables("统计表1")
For c
As Integer = 0 To t.Cols.Count - 1 '设置列宽
t.Cols(c).Width = 35
Next
t.Cols("设备编号").Width = 70
MainTable = Tables("统计表1")
[此贴子已经被作者于2019/6/7 21:36:25编辑过]