-- 作者:大雪山
-- 发布时间: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编辑过]
|
-- 作者:大雪山
-- 发布时间:2017/10/20 8:16:00
--
序号问题如何修改公式?
For i As Integer = p * prs To math.min(mxh - 1,( p + 1) * prs - 1) \'For i As Integer = 0 To mxhd - 1 rt.Rows(rt.Rows.Count).Height = 5 rt.Rows(rt.Rows.Count-1).Style.Font = New Font("宋体", 10, FontStyle.Regular) rt.Cells(rt.Rows.Count-1,0).SpanCols = 1 \'向右合并2列 rt.Cells(rt.Rows.Count-1,1).SpanCols = 2 \'向右合并2列 rt.Cells(rt.Rows.Count-1,3).SpanCols = 2 \'向右合并2列 rt.Cells(rt.Rows.Count-1,5).SpanCols = 4 \'向右合并2列 \'rt.Cells(rt.Rows.Count-1,4).SpanCols = 3 \'向右合并2列 rt.Cells(rt.Rows.Count-1,9).SpanCols = 5 \'向右合并2列 rt.Cells(rt.Rows.Count-1,14).SpanCols = 2 \'向右合并2列 \'rt.Cells(rt.Rows.Count-1,12).SpanCols = 4 \'向右合并2列 rt.Cells(rt.Rows.Count-1,0).Style.GridLines.left = New prt.Linedef(0.5,clr) rt.Cells(rt.Rows.Count-1,12).Style.GridLines.Right = New prt.Linedef(0.5,clr) If i < cnt Dim xuhao As Integer = 1 rt.Cells(rt.Rows.Count-1,0).Text = xuhao xuhao = xuhao+1
此主题相关图片如下:hq{vxtz7vqgc)ticwlb%fg.png

|