Foxtable(狐表)用户栏目专家坐堂 → 报表


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

主题:报表

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
报表  发帖心情 Post By:2016/10/12 21:47:00 [显示全部帖子]

Dim doc As New PrintDoc
Dim rt As Prt.RenderTable
Dim rx As prt.RenderText
Dim tbl As Table = Tables("统计_table1")
Dim Rows As List(Of DataRow)
Dim Regions As List(Of String) = tbl.DataTable.GetValues("班级")
''doc.Pagesetting.LandScape = True 设置横向打印
For Each Region As String In Regions
    rx = New prt.RenderText
    rx.Style.FontSize = 14
    rx.Style.FontBold = True
    rx.Style.Spacing.Bottom = 2
    rx.Text = "班级: " & Region
    doc.Body.Children.Add(rx)
    rt = New prt.RenderTable
    Doc.PageSetting.LeftMargin = 10 '设置左边距
    Doc.PageSetting.RightMargin = 10 '设置右边距
    Doc.PageSetting.TopMargin = 10 '设置上边距
    Doc.PageSetting.BottomMargin = 10 '设置下边距
    
    ''rt.Width = "Parent.Width" '对象宽度等于页面宽度
    ''rt.Height = "Parent.Height" '对象高度等于页面高度
    
    ''rt.Width = 180 '设置表格的宽度为120毫米
    ''rt.Height = 280 '设置表格的高度为100毫米
    rt.Style.Font = Tables("统计_table1").Font
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center
    rt.Style.GridLines.All = New prt.LineDef(0.3,Color.black)
    rt.Style.Spacing.Bottom = 5
    rt.CellStyle.Spacing.All = 1
    rt.Style.Font = tbl.Font
    Rows = tbl.DataTable.Select("[班级] = '" & Region & "'")
    For c As Integer = 5 To tbl.Cols.Count - 1
        rt.Cells(0,c-5).Text = tbl.Cols(c).Name
        rt.Cols(c-5).Width = tbl.Cols(c).PrintWidth
        For r As Integer = 0 To Rows.Count -1
            rt.Cells(r + 1, c-5).Text = rows(r)(tbl.Cols(c).Name)
        Next
    Next
    rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
    doc.Body.Children.Add(rt)
Next
doc.preview()

老师,打成绩表时要分班打,如果打完一个班后重新的一页开始,怎么改,谢谢

 回到顶部