Foxtable(狐表)用户栏目专家坐堂 → 关于ListView的显示问题


  共有4619人关注过本帖平板打印复制链接

主题:关于ListView的显示问题

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2019/4/15 21:21:00 [只看该作者]

Dim de As Table = Tables("临时箱单")
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim Style As XLS.Style = Book.NewStyle() '定义新样式
Style.BorderTop = XLS.LineStyleEnum.Thin
Style.BorderBottom = XLS.LineStyleEnum.Thin
Style.BorderLeft = XLS.LineStyleEnum.Thin
Style.BorderRight = XLS.LineStyleEnum.Thin
Style.BorderColorTop = Color.Black
Style.BorderColorBottom = Color.Black
Style.BorderColorLeft = Color.Black
Style.BorderColorRight = Color.Black
Sheet.Rows(0).Height = 30 '设置第1行的行高
Style.AlignHorz = XLS.AlignHorzEnum.Center
Style.AlignVert = XLS.AlignVertEnum.Center
de.CreateSheetHeader(Sheet,1,0,False)'生成表头
Sheet(0,0).Value = "产品销售统计"
Dim styel1 As XLS.Style = Book.NewStyle() '定义新样式
styel1.font = New Font("雅黑", 16, FontStyle.Bold)
Sheet(0,0).Style = styel1
For r As Integer = 0 To de.Rows.Count - 1 '填入数据
    For c As Integer = 0 To de.Cols.Count -1
        Sheet.Cols(0).Width = 120
        Sheet.Cols(1).Width = 120
        Sheet.Cols(2).Width = 70
        Sheet.Cols(3).Width = 120
        For a As Integer = 4 To de.Cols.Count -3
            Sheet.Cols(a).Width = 30 '设置第1列的宽度
        Next
        For a As Integer = de.Cols.Count -2 To de.Cols.Count -1
            Sheet.Cols(a).Width = 50 '设置第1列的宽度
        Next
        Sheet.MergeCell(0,0,1,c+1)
        Sheet(r +3 , c).Value = de.rows(r)(c)
        Sheet(r +3, c).Style = Style
        Sheet(0,c).Style = Style
        Sheet(1,c).Style = Style
        Sheet(2,c).Style = Style
    Next
Next
Book.Save("c:\reports\test.xls")
Dim Proc As New Process
Proc.File = "c:\reports\test.xls"
Proc.Start()

没反应!图片点击可在新窗口打开查看


 回到顶部
总数 43 1 2 3 4 5 下一页