Foxtable(狐表)用户栏目专家坐堂 → 导出数据时提示超出65536行(已改为xlsx)


  共有4114人关注过本帖树形打印复制链接

主题:导出数据时提示超出65536行(已改为xlsx)

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111381 积分:566969 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/29 10:28:00 [显示全部帖子]

Dim dt As DataTable = cmd.ExecuteReader()

Dim Book As New XLS.Book
Dim fl As String = "c:\reports\test.xlsx" 
Book.Save(fl)
'重新打开工作簿
Book = New XLS.Book(fl)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim Style As Xls.Style = Book.NewStyle 
Style.BackColor = Color.Red

For c As Integer = 0 To nms.Count - 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.Count - 1 
        Sheet(r + 1, c).Value = dt.DataRows(r)(nms(c))
    Next
Next

Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()

 回到顶部