With wb.AddButtonGroup("","btg1",True)
.Add("btn4", "生成Excel格式订单", "button","orders.htm")
End With
Case "orders.htm"
Dim nms() As String = {"姓名","性别","类型","合格证等级","发证日期","有效期至","体检证过期"}
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "SelecXX 姓名,性别,类型,合格证等级,发证日期,有效期至,体检证过期 From {体检合格证}"
Dim dt As DataTable = cmd.ExecuteReader
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For c As Integer = 0 To nms.Length - 1
Sheet(0, c).Value = nms(c)
Next
For r As Integer = 0 To dt.DataRows.Count - 1
For c As Integer = 0 To nms.Length - 1
Sheet(r + 1, c).Value = dt.Datarows(r)(nms(c))
Next
Next
book.PreBuild = False '非报表模请将PreBuild 属性设置为False
e.WriteBook(book,"体检合格证.xls",True)