Dim Values() As String = {"总分"}
Dim s1() As String = New String() {"总分"}
Dim dt As Table = Tables("成绩库")
Dim lm1s() As String = {"序号","部别","年级","科目"}
Dim lm2s() As String = {"参考人数","平均分","标准差"}
Dim dhs() As String = {"重点A","本科A","专科A"}
Dim lm3s() As String = {"平均分","标准差","平均分之和","标准差之和","目标","重点线","有效分"}
Dim tjnj As String = 2018
For Each Value As String In Values
Dim dtb As New DataTableBuilder( value & tjnj & "级有效分")
For Each lm1 As String In lm1s
dtb.AddDef( lm1 ,Gettype(String),8)
Next
For Each lm2 As String In lm2s
dtb.AddDef( lm2 ,Gettype(Double))
Next
For Each lm3 As String In lm3s
For Each dh As String In dhs
For i As Integer = 1 To 7
dtb.AddDef( dh & i ,Gettype(Double),"", dh & "_ "& lm3 &"")
Next
Next
Next
dtb.Build()
Next
执行代码报错:
此主题相关图片如下:报错.png
红色部分代码是下面代码的简化:
dtb.AddDef("重点A1",Gettype(Double),"","重点A及以上_平均分")
dtb.AddDef("重点A2",Gettype(Double),"","重点A及以上_标准差")
dtb.AddDef("重点A3",Gettype(Double),"","重点A及以上_平均分之和")
dtb.AddDef("重点A4",Gettype(Double),"","重点A及以上_标准差之和")
dtb.AddDef("重点A5",Gettype(Double),"","重点A及以上_目标")
dtb.AddDef("重点A6",Gettype(Double),"","重点A及以上_重点线")
dtb.AddDef("重点A7",Gettype(Double),"","重点A及以上_有效分")
dtb.AddDef("本科A1",Gettype(Double),"","本科A及以上_平均分")
dtb.AddDef("本科A2",Gettype(Double),"","本科A及以上_标准差")
dtb.AddDef("本科A3",Gettype(Double),"","本科A及以上_平均分之和")
dtb.AddDef("本科A4",Gettype(Double),"","本科A及以上_标准差之和")
dtb.AddDef("本科A5",Gettype(Double),"","本科A及以上_目标")
dtb.AddDef("本科A6",Gettype(Double),"","本科A及以上_本科线")
dtb.AddDef("本科A7",Gettype(Double),"","本科A及以上_有效分")
dtb.AddDef("专科A1",Gettype(Double),"","专科A及以上_平均分")
dtb.AddDef("专科A2",Gettype(Double),"","专科A及以上_标准差")
dtb.AddDef("专科A3",Gettype(Double),"","专科A及以上_平均分之和")
dtb.AddDef("专科A4",Gettype(Double),"","专科A及以上_标准差之和")
dtb.AddDef("专科A5",Gettype(Double),"","专科A及以上_目标")
dtb.AddDef("专科A6",Gettype(Double),"","专科A及以上_专科线")
dtb.AddDef("专科A7",Gettype(Double),"","专科A及以上_有效分")
建表样式:
此主题相关图片如下:有效分样式.png
如何修改红色部分代码?请指教,谢谢!