Foxtable(狐表)用户栏目专家坐堂 → [求助]分页打印公式修改


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

主题:[求助]分页打印公式修改

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


加好友 发短信
等级:童狐 帖子:290 积分:2931 威望:0 精华:0 注册:2008/9/29 10:13:00
[求助]分页打印公式修改  发帖心情 Post By:2017/10/18 21:59:00 [只看该作者]

加一个每页指定打印40行公式,如何修改?

 

 

Dim top As Integer = getConfigValue("上边距",10)
Dim lft As Integer = getConfigValue("左边距",16)
Dim btm As Integer = getConfigValue("下边距",10)
Dim fl As Integer = getConfigValue("分栏距",6)
Dim zrs As Integer = 1
Dim dqh As Integer = Tables("student").Position
If getConfigValue("全部打印",True) = True
    zrs = DataTables("student").DataRows.Count
End If
Dim clr As Color = Color.white
If getConfigValue("填表模式",True) = False
    clr = Color.Black
End If
Dim s As String
Dim mxh,cnt As Integer
Dim dr As DataRow
Dim h As Integer = Top
'-------------------------------------------------------以下代码定义报表
Dim doc As New PrintDoc() '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim rx As New prt.RenderText '定义一个文本对象
Dim ra As New prt.RenderArea '定义一个容器
doc.PageSetting.Width = 210 '纸张宽度为210毫米
doc.PageSetting.Height = 297 '纸张高度为120毫米
doc.AutoRotate = False '禁止自动旋转打印内容
doc.PageSetting.Landscape = False '横向打印
Doc.PageSetting.TopMargin = top '设置上边距
Doc.PageSetting.LeftMargin = lft '设置左边距
Doc.PageSetting.BottomMargin = btm '设置下边距

Dim drs As List(Of DataRow)
For rn As Integer = 0 To zrs - 1
    If getConfigValue("全部打印",True) = True
        dqh = rn
    End If
    dr = Tables("student").Rows(dqh).DataRow
    drs = dr.GetChildRows("ksxx")
    If drs.Count = 0
        Continue For
    End If
    rt = New prt.RenderTable() '定义一个表格对象
    rx = New prt.RenderText '定义一个文本对象
    ra = New prt.RenderArea '定义一个容器
    ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never  '禁止容器因为分页而被垂直分割
    ra.Width = "177mm"
    rt.Style.GridLines.All = New prt.LineDef(clr) '将网格线类型设为默认类型Color.White
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    rt.Style.Spacing.Top = 5 '表格和前面对象的垂直间隔为5毫米
    rt.Style.Spacing.Bottom = 5 '表和和后续对象的垂直间隔为5毫米
    rt.Style.Spacing.All = 2 '所有表格内边距为2mm
    rt.Style.Borders.all = New prt.Linedef(0,Color.White)

[此贴子已经被作者于2017/10/18 21:59:14编辑过]

 回到顶部
总数 18 1 2 下一页