以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求帮忙修改专业报表  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=41923)

--  作者:飞天
--  发布时间:2013/10/30 12:18:00
--  求帮忙修改专业报表
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:物资进销存管理.foxdb


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

希望实现自动控制每页9行.(自动换页)
[此贴子已经被作者于2013-10-30 12:18:42编辑过]

--  作者:Bin
--  发布时间:2013/10/30 14:12:00
--  
http://www.foxtable.com/help/topics/2241.htm
--  作者:飞天
--  发布时间:2013/10/30 18:09:00
--  
谢谢你.但我实在是不知道如何应用到这个代码中来
--  作者:有点甜
--  发布时间:2013/10/30 19:26:00
--  
 照着例子改一下吧。就不帮你做了。