Dim Book As New XLS.Book("c:\reports\fs.xls")
Dim Sheet1 As XLS.Sheet = Book.Sheets(1)
For l As Integer = 0 To t.dataCols.count - 1
sheet1(0,l).value = t.dataCols(l).Name
Next
For i As Integer = 0 To t.dataRows.Count - 1
For j As Integer = 0 To t.dataCols.count - 1
Dim s As String = t.DataCols(j).Name
If t.DataCols(j).IsDate
If t.DataRows(i)(s) = "#0001-01-01 0:00:00#"
sheet1(i + 1,j).Value = Nothing
Else
sheet1(i + 1,j).Value = t.dataRows(i)(s)
sheet1(i+1,j).NumberFormat = "yyyy-m-d" '日期
最后这一句想实现导出到EXCEL中的显示日期格式,这句代码有问题,如果没有最后一句,打开EXCEL中看到的日期数据是整数.