Foxtable(狐表)用户栏目专家坐堂 → 报表打印输出横向合并单元格如何做?


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

主题:报表打印输出横向合并单元格如何做?

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/1 11:17:00 [显示全部帖子]

Dim Book As New XLS.Book("d:\abc.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For i As Integer = 1 To sheet.Rows.count-1
    Dim li As Integer = 0
    Dim ri As Integer = 0
    For j As Integer = 0 To 3
        If sheet(i,j).text > "" Then
            li = j
        Else
            ri = j
        End If
    Next
    Sheet.MergeCell(i,li,1,ri-li+1)
Next
Book.Save("d:\123.xls")
Dim Proc As New Process
Proc.File = "d:\123.xls"
Proc.Start()

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/3/1 22:25:00 [显示全部帖子]

Dim Book As New XLS.Book(ProjectPath & "1.xls")
Dim fl As String = ProjectPath & "Reports\123.xls"
Book.Build() '生成细节区
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For i As Integer = 1 To sheet.Rows.count-1
    Dim li As Integer = 0
    Dim ri As Integer = 0
    For j As Integer = 0 To 3
        If sheet(i,j).text > "" Then
            li = j
        Else
            ri = j
        End If
    Next
    Sheet.MergeCell(i,li,1,ri-li+1)
Next
Book.Save(fl) '保存
Dim Proc As New Process
Proc.File = fl
Proc.Start()

 回到顶部