以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  新报表打印  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=84022)

--  作者:qinlao666
--  发布时间:2016/4/21 16:34:00
--  新报表打印

老师我定义了一个新报表,打印的时候,我想让这个报表在我指定的位置开始打印,而不顶头打印,请问老师如何实现


--  作者:qinlao666
--  发布时间:2016/4/21 16:37:00
--  


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

 

就是想上图中的表格打印的时候,往下移动写


--  作者:qinlao666
--  发布时间:2016/4/21 16:38:00
--  

e.Form.Page.Width = 140 \'纸张宽度为100毫米
e.Form.Page.Height = 220 \'纸张高度为120毫米
e.Form.Page.LeftMargin = 2 \'设置左边距
e.Form.Page.RightMargin = 0 \'设置右边距
e.Form.Page.TopMargin = 8 \'设置上边距
e.Form.Page.BottomMargin = 0 \'设置下边距
Dim doc As PrintDoc = e.Form.GernatePrintDoc()
For Each c As Object In doc.body.children
    If typeof c Is prt.RenderText Then
        c.Style.Borders.All = New prt.Linedef(0.005, Color.gainsboro)
    End If
Next

Dim rt As New prt.RenderTable \'定义一个新表格
Dim tb As Table = Tables("入库主表.入库明细")
Dim ColNames As String() = New String(){"物料编码", "仓库类别", "物料名称","物料型号", "物料材质", "入库数量","单价", "金额", "备注"}
rt.Width = "Auto" \'表格宽度为自动,也就是等于各列设置宽度之和
rt.SplitHorzBehavior = prt.SplitBehaviorEnum.SplitIfNeeded \'表格宽度超出页宽时,可以水平换页
rt.Style.Font = tb.Font
For c As Integer = 0 To ColNames.Length - 1 \'逐列设置和填入内容
    rt.Cells(0,c).Text = ColNames(c) \'列名作为标题
    rt.Cells(0,c).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'标题内容水平居中
    rt.Cols(c).Width = tb.Cols(ColNames(c)).PrintWidth \'列宽等于实际列宽
    If tb.Cols(ColNames(c)).IsNumeric OrElse tb.Cols(ColNames(c)).IsDate Then \'如果是数值或日期列
        rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Right \'数据水平靠右
    End If
    For r As Integer = 0 To tb.Rows.Count -1 \'开始填入该列内容
        rt.Cells(r + 1, c).Text = tb.Rows(r)(ColNames(c))
    Next
Next
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray) \'灰色网格线
rt.CellStyle.Spacing.All = 0.5 \'单元格内距设为0.5毫米
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'第一行内容水平居中
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All \'利用行组,将第一行设为表头.
doc.Body.Children.Add(rt) \'将表格加入到报表
\'如果需要分栏打印,请加上下面两行
\'doc.Columns.Add()
\'doc.Columns.Add()

For Each c As Object In doc.body.children
    If typeof c Is prt.RenderText Then
        c.Style.Borders.All = New prt.Linedef(0.005, Color.gainsboro)
    End If
Next
doc.Preview()


--  作者:qinlao666
--  发布时间:2016/4/21 16:38:00
--  
老师请帮我处理下
--  作者:大红袍
--  发布时间:2016/4/21 16:41:00
--  
你在顶头加一个容器,控制这个容器的高度就可以了,相当于打印一个空白的东西。