生成统计表之后,输出的代码:
Tables("袁驿中学问卷分科目得分").SaveExcel("c:\data\001.xls","统计")
Dim book As new XLS.Book("c:\data\001.xls")
Dim sheet As XLS.Sheet = book.Sheets(0)
Dim Style As Xls.Style = Book.NewStyle '新建一个样式
Style.ForeColor = Color.Red '样式的背景颜色设为红色
Style.Font = new font("宋体",10,FontStyle.Bold)
For i As Integer = 2 To sheet.Rows.count -1
If sheet(i,4).Text.EndsWith("计") Then
For n As Integer = 0 To sheet.Cols.count -1
sheet(i,n).Style = Style
Next
End If
Next
Book.save(("c:\data\001.xls"))