Foxtable(狐表)用户栏目专家坐堂 → 专业报表中,如何使用报表自动换页


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

主题:专业报表中,如何使用报表自动换页

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


加好友 发短信
等级:幼狐 帖子:172 积分:1914 威望:0 精华:0 注册:2012/6/6 17:08:00
专业报表中,如何使用报表自动换页  发帖心情 Post By:2013/10/30 11:38:00 [只看该作者]

Dim doc As New Printdoc
Dim rx As prt.RenderText
Dim rt As prt.RenderTable
Dim Rows As List(Of DataRow)
Dim tbl As Table = Tables("出库单")

rx = New prt.RenderText
rx.Style.FontSize = 14
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 5
rx.Text = "XXX公司出货订单"
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center
doc.Body.Children.Add(rx)

rx = New prt.RenderText
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 3
rx.Text = "出库单号:" & tbl.Current("出库单号")
rx.style.TextAlignHorz = prt.AlignHorzEnum.Left
Doc.Body.Children.Add(rx)

rt = New prt.RenderTable
rt.Style.Spacing.Bottom = 3
rt.Cols.Count = 2
rt.Style.FontBold = True
rt.Cells(0,0).Text = "领用部门:" & tbl.Current("领用部门") & "    出库日期:" & tbl.Current("出库日期")
rt.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rt.Cells(0,1).Text = "领料人:" & tbl.Current("领料人")
rt.Cells(0,1).Style.TextAlignHorz = prt.AlignHorzEnum.Right
Doc.Body.Children.Add(rt)

rt = New prt.RenderTable
rt.Style.Spacing.Bottom = 3
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.Style.Borders.Bottom = New prt.LineDef(0.3,Color.LightGray)
rt.CellStyle.Spacing.All = 1
rt.Cols.Count = 6
rt.Cells(0,0).Text = "物料代码"
rt.Cells(0,1).Text = "物料名称"
rt.Cells(0,2).Text = "规格型号"
rt.Cells(0,3).Text = "单位"
rt.Cells(0,4).Text = "数量"
rt.Cells(0,5).Text = "备注"
rt.rows(0).Style.Borders.Top = New prt.LineDef(1,Color.LightGray)
rt.rows(0).Style.Borders.Bottom = New prt.LineDef(1,Color.LightGray)
With Tables("出库单.出库明细")
    For r As Integer = 0 To 9
        If r < .Rows.Count Then
            rt.Cells(r+1,0).Text = .rows(r)("物料代码")
            rt.Cells(r+1,1).Text = .rows(r)("物料名称")
            rt.Cells(r+1,2).Text = .rows(r)("规格型号")
            rt.Cells(r+1,3).Text = .rows(r)("单位")
            rt.Cells(r+1,4).Text = .rows(r)("数量")
            rt.Cells(r+1,5).Text = .rows(r)("备注")
        Else
            rt.Cells(r+1, 0).Text = " "
        End If
    Next
End With
doc.Body.Children.Add(rt)

rt = New prt.RenderTable
rt.Style.Spacing.Bottom = 3
rt.Cols.Count = 2
rt.Style.FontBold = True
rt.Cells(0,0).Text = "库管员:" & tbl.Current("库管员")
rt.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rt.Cells(0,1).Text = "合计:" & Tables("出库单.出库明细").Compute("Sum(数量)")
rt.Cells(0,1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
Doc.Body.Children.Add(rt)

doc.Preview


问题1:希望再加上每行都有一条横线.
问题2:如何实现明细表超出9行时,自动换页.

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2013/10/30 11:42:00 [只看该作者]

横线可以设置表格的下边框

分页和页眉等参考下面


http://www.foxtable.com/help/topics/2241.htm
[此贴子已经被作者于2013-10-30 11:43:24编辑过]

 回到顶部