或者在生成的时候用表达式
'---------以下代码增加临时表用于统计数据,表名为<统计>
Dim TJ As New DataTableBuilder("统计")
TJ.AddDef("姓名", Gettype(String), 16) '新增姓名列
For Each DL As String In DataTables("表设置").GetValues("大类","","_SORTKEY") '遍历<表设置>中的各个字段
If DL <> "" Then '大类的空行不计入
For Each FL As String In DataTables("表设置").GetValues("分类","","_SORTKEY")
If FL <>"" Then '分类的空行不计入
TJ.AddDef(dl & "_" & fl,Gettype(Integer))
End If
Next
End If
Next
Dim fenlei As List(of String) = DataTables("表设置").GetValues("分类", "分类 is not null")
Dim dalei As List(of String) = DataTables("表设置").GetValues("大类", "大类 is not null")
For Each f As String In fenlei
Dim str As String = ""
For Each d As String In dalei
str &= "isnull(" & d & "_" & f & ", 0)+"
Next
TJ.AddDef("总评_" & f,Gettype(Integer),str.trim("+"))
Next
TJ.Build