用如下代码统计,生产的表格顺序很乱,能不能顺序不要乱就按日期顺序来呀,请求帮助,谢谢!,代码如下:
e.Form.Controls("Textbox10").Value = Nothing
Dim b As New CrossTableBuilder("装配计划表1",DataTables("装配日计划"))
b.HGroups.AddDef("序列号")
b.HGroups.AddDef("产品名称")
b.HGroups.AddDef("订单数量")
b.HGroups.AddDef("排产数量")
b.HGroups.AddDef("生产备注")
b.HGroups.AddDef("排产日期",DateGroupEnum.none)
b.VGroups.AddDef("排产日期",DateGroupEnum.Year,"{0}年")
b.VGroups.AddDef("排产日期","{0}月")
b.VGroups.AddDef("排产日期",DateGroupEnum.day,"{0}日")
b.Totals.AddDef("排产数量")
b.OrderByTotal = True
b.VerticalTotal= True
b.HorizontalTotal = True
Dim t As Table = e.form.controls("Table11").Table
t.datasource = b.BuildDataSource
t.DataTable.GlobalHandler.AfterEdit = True
t.AllowEdit = True
e.form.controls("Table11").Table.AutoSizeCols(3)
t.DefaultRowHeight = 31
t.DataTable.DataCols.Add("_sortkey", Gettype(Decimal))
For Each r As Row In t.Rows
r("_sortkey") = r.Index
Next
t.rows(t.rows.count - 1).Move(0)
t.Sort = "_sortkey"
t.DataTable.AcceptChanges
t.ResumeRedraw
生产图片如下:
此主题相关图片如下:1.jpg

能否变成如下按顺序的:
此主题相关图片如下:2.jpg

谢谢老师们,救急