加一个每页指定打印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编辑过]