以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何给导出的电子做表格  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=78875)

--  作者:lihe60
--  发布时间:2015/12/19 8:05:00
--  如何给导出的电子做表格
 

Dim tbl As Table = Tables("产品")
Dim
hdr As Integer = tbl.HeaderRows \'获得表头的层数
Dim
Book As New XLS.Book
Dim
Sheet As XLS.Sheet = Book.Sheets(0)
tbl
.CreateSheetHeader(Sheet,0,0,False) \'生成表头
For
c As Integer = 0 To tbl.Cols.Count - 1
    For
r As Integer = 0 to tbl.Rows.Count - 1
       
sheet(r + hdr,c).value = tbl(r,c)
    Next
Next

Book
.Save("c:\\reports\\test.xls")
Dim
Proc As New Process
Proc
.File = "c:\\reports\\test.xls"
Proc
.Start()

 

 

这个代码导出的电子表没有表格,如何给电子表加上表格线?


--  作者:Hyphen
--  发布时间:2015/12/19 9:12:00
--  

参考http://www.foxtable.com/help/topics/1163.htm