-- 作者:yyzlxc
-- 发布时间:2013/4/11 18:59:00
-- [求助]水平分组引用字符列(已解决)
在kqmx表中有列“备注”的字符列,要求加入到水平方向的分组中,有什么办法可以实现,请各位老师指教,谢谢!!
\'根据kqmx表生成交叉汇总表 Dim f As New CrossTableBuilder("当月个人考勤汇总", DataTables("kqmx")) f.HGroups.AddDef("编号") f.HGroups.AddDef("姓名") f.VGroups.AddDef("日期",DateGroupEnum.None) f.Totals.AddDef("在册","天数") f.Totals.AddDef("出勤") f.Totals.AddDef("公出") f.Totals.AddDef("公休") f.Totals.AddDef("事假") f.Totals.AddDef("病假") f.Totals.AddDef("其他") f.HorizontalTotal = True \'水平汇总 f.Build() MainTable = Tables("当月个人考勤汇总") Dim t As Table = Tables("当月个人考勤汇总") Dim a As Integer = Tables("当月个人考勤汇总").Cols.Count MessageBox.Show(a)
Dim i As Integer = (Tables("当月个人考勤汇总").Cols.Count - 9)/7 For j As Byte = 1 To i Tables("当月个人考勤汇总").Cols("在册_" & j).Visible = False Next For Each c As Col In t.Cols If c.DataCol.IsNumeric Then c.TextAlign = TextAlignEnum.Center End If Next For Each dc As DataCol In t.DataTable.DataCols If dc.IsNumeric Then For Each dr As DataRow In t.DataTable.DataRows If dr(dc.name) = 0 dr(dc.name) = Nothing End If Next End If Next t.DataTable.DataCols.Add("合计_出勤率", Gettype(Double)) For Each dr As DataRow In DataTables("当月个人考勤汇总").DataRows dr("合计_出勤率") = (dr("合计_出勤") + dr("合计_公出")) / dr("合计_天数") * 100 Next DataTables("当月个人考勤汇总").DataCols("合计_出勤率").SetFormat("0.00") CurrentTable.Cols("合计_天数").Move(2) CurrentTable.Cols("合计_出勤").Move(3) CurrentTable.Cols("合计_公出").Move(4) CurrentTable.Cols("合计_出勤率").Move(5) CurrentTable.Cols("合计_公休").Move(6) CurrentTable.Cols("合计_事假").Move(7) CurrentTable.Cols("合计_病假").Move(8) CurrentTable.Cols("合计_其他").Move(9) Tables("当月个人考勤汇总").AutoSizeCols()
[此贴子已经被作者于2013-4-12 7:42:40编辑过]
|