If e.PostValues("xd")="高中"
nms = new String() {"考试名称","考试室","考号","姓名","语文_语总","数学_数总","英语_英总","政治_政总","历史_历总","地理_","物理_物总","化学_化总","生物_","总分","总分班序","总分校序","总分区序"}
cps = new String() {"考试名称","考试室","考号","姓名","语文","数学","英语","政治","历史","地理","物理","化学","生物","总分","班序","校序","区序"}
End If
Dim lst As List(of DataRow) = DataTables("成绩").sqlSelect("考试名称= '" & e.PostValues("ksmc") & "' and 学段 = '" & e.PostValues("xd") & "' And 单位名称 = '" & dr("group") & "'")
'wb.InsertHTML("<div style='width:100%; overflow-x:auto;'>")
'wb.InsertHTML("<Table border='1'cellpadding='0' align='center'>")
'wb.InsertHTML("<tr>")
'For Each cp As String In cps
' wb.InsertHTML("<td style='font-size:20px;color:blue;white-space:nowrap;' align='center'>" & cp & "</td>")
'Next
'wb.InsertHTML("</tr>")
' For r As Integer=0 To lst.Count-1
' wb.InsertHTML("<tr>")
' For Each nm As String In nms
' wb.InsertHTML("<td style='font-size:16px;white-space:nowrap;' align ='center'>" & lst(r)(nm) & "</td>")
' Next
' wb.InsertHTML("</tr>")
' Next
'wb.InsertHTML("</Table></br></br></br>")
' wb.InsertHTML("</div>")
With wb.AddTable("","Table1")
老师,我测试了多次,当有记录多时,注释掉的方式就会出错,经研究发现,其实用wb.AddTable("","Table1")可以显示多列了,现在我就想把注释掉的方式改成用wb.AddTable("","Table1"),这个如何改,cps,nms是动态的