狐表做这个太容易了.
做个按钮,写代码
Dim dt As Table = Tables("临时表")
Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
For c As Integer = 0 To dt.Cols.Count -1 '添加列标题
Sheet(0, c).Value = dt.Cols(c).Name
Next
For r As Integer = 0 To dt.Rows.Count - 1 '填入数据
For c As Integer = 0 To dt.Cols.Count -1
Sheet(r +1, c).Value = dt.rows(r)(c)
Next
Next
'打开工作簿
Book.Save("c:\reports\临时表.xls")
Dim Proc As New Process
Proc.File = "c:\reports\临时表.xls"
Proc.Start()