Foxtable(狐表)用户栏目专家坐堂 → [求助] 如何编写这样的代码


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

主题:[求助] 如何编写这样的代码

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2013/7/14 8:11:00 [显示全部帖子]

Dim doc As New PrintDoc '定义一个报表
doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置排列方式
For Each r As  Row In Tables("产品").GetCheckedRows()
    For i As Integer = 1 To r("份数")
        Dim rt As New prt.RenderTable() '定义一个表格对象
        rt.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
        rt.Width = 80 '表格宽度为80mm
        rt.Style.Spacing.All = 3 '和其他对象之间的间隔为2mm
        rt.SplitVertBehavior = prt.SplitBehaviorEnum.Never '避免垂直换页的时候,表格被分割成两部分.
        rt.Cols(0).Width = 15
        rt.cells(0,0).Text = "产品编号"
        rt.cells(0,1).text = Tables("产品").current("产品编号")
        rt.Cells(1,0).Text = "成份比例"
        rt.cells(1,1).text = Tables("产品").current("成分比例")
        rt.Cells(2,0).Text = "纱支"
        rt.cells(2,1).text = Tables("产品").current("纱支")
        rt.Cells(3,0).Text = "密度"
        rt.cells(3,1).text = Tables("产品").current("密度")
        rt.Cells(4,0).Text= "幅宽"
        rt.cells(4,1).text = Tables("产品").current("幅宽")
        rt.cells(5,0).text = "克重"
        rt.cells(5,1).text = Tables("产品").current("克重")
        rt.cells(6,0).Text = "备注"
        rt.cells(6,1).text = Tables("产品.产品调用明细表").current("备注")
        rt.Cells(7,0).SpanCols =2
        rt.cells(7,0).text = "           上海佑冉经贸发展有限公司"
        rt.Rows(7).Style.BackColor = Color.LightGray
        doc.Body.Children.Add(rt) '将表格对象加入到报表中
    Next
Next
Doc.Preview() '预览报表


 回到顶部