Foxtable(狐表)用户栏目专家坐堂 → 如何打印目录树报表


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

主题:如何打印目录树报表

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


加好友 发短信 一级勋章
等级:MVP荣誉狐 帖子:5154 积分:31434 威望:0 精华:8 注册:2008/9/8 12:27:00
  发帖心情 Post By:2011/6/18 19:37:00 [显示全部帖子]

If FileSys.FileExists("c:\reports\test.xls") Then
    FileSys.DeleteFile("c:\reports\test.xls")
End If
Dim tbl As Table =Tables(Forms("窗口1").name & "_table1")
Dim hdr As Integer = tbl.HeaderRows '获得表头的层数
Dim cnt,cnt2 As Integer
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
tbl.CreateSheetHeader(Sheet) '生成表头
For c As Integer = 0 To tbl.Cols.Count() - 1
    If tbl.Cols(c).Visible Then
        For r As Integer = 0 To tbl.Rows.Count(True) - 1
            sheet(r + hdr,cnt).value = tbl(r,c,True)
        Next
        cnt = cnt + 1
    End If
Next
Book.Save("c:\reports\test.xls")
cnt = 0

For r0 As Integer = 1 To tbl.Rows.Count(True)
    cnt = r0 -cnt2
    output.show(r0 & " = cnt: " & cnt & "  " &   cnt2 & "  " &  sheet(cnt,0).value)
    If right(sheet(cnt,0).value,2) <> "小计" Then
        Sheet.Rows.RemoveAt(cnt)
        cnt2 = cnt2 + 1
    Else
    End If
Next

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


 回到顶部