以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何设置表格与前面数据的距离 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=175974) |
-- 作者:lihe60 -- 发布时间:2022/3/25 14:50:00 -- 如何设置表格与前面数据的距离 附件为官方的 Dim doc As New PrintDoc Dim tb As Table = Tables("订单") Dim prs As Integer = 37 \'每页20行 For p As Integer = 0 To math.Ceiling(tb.Rows.Count / prs) - 1 Dim rx As New prt.RenderText rx.Text = "2010年订单" rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center rx.Style.Spacing.Bottom = 3 Doc.body.Children.Add(rx) rx = New prt.RenderText rx.Text = "中国人民共和国万岁" rx.width=40 rx.Style.Font = New Font("宋体", 12, FontStyle.Bold) rx.Style.TextAlignHorz = prt.AlignHorzEnum.left rx.Style.Spacing.Bottom = 3 rx.x=20 rx.y=32 Doc.body.Children.Add(rx) rx = New prt.RenderText rx.Text = "世界人民大团结万岁" rx.width=40 rx.Style.Font = New Font("宋体", 12, FontStyle.Bold) rx.Style.TextAlignHorz = prt.AlignHorzEnum.left rx.Style.Spacing.Bottom = 0 rx.x=80 rx.y=32 Doc.body.Children.Add(rx) rx = New prt.RenderText rx.Text = "作者" rx.Style.Font = New Font("宋体", 12, FontStyle.Bold) rx.Style.TextAlignHorz = prt.AlignHorzEnum.left rx.Style.Spacing.Bottom = 3 rx.y=250 Doc.body.Children.Add(rx) Dim rt As New prt.RenderTable rt.Style.Gridlines.All = New prt.Linedef(Color.Gray) rt.CellStyle.Spacing.All = 0.5 For c As Integer = 0 To tb.Cols.Count - 1 rt.Cells(0,c).Text = tb.Cols(c).Name If tb.cols(c).isnumeric rt.Style.TextAlignHorz = prt.AlignHorzEnum.right End If If tb.Cols(c).Name="客户" rt.Cols(c).Width =10 End If For r As Integer = p * prs To math.min(tb.Rows.Count - 1,( p + 1) * prs - 1) rt.Cells(r - p * prs + 1, c).Text = tb.rows(r)(c) Next Next If p < math.Ceiling(tb.Rows.Count / prs) - 1 rt.BreakAfter = prt.BreakEnum.Page End If doc.Body.Children.Add(rt) Next doc.Preview() |
-- 作者:有点蓝 -- 发布时间:2022/3/25 14:57:00 -- http://www.foxtable.com/webhelp/topics/1173.htm |
-- 作者:lihe60 -- 发布时间:2022/3/25 15:17:00 -- rt.Style.Spacing.Bottom = 3 \'设置下间隔为3毫米 加了这行代码,还是不行。请贴出代码。
|
-- 作者:lihe60 -- 发布时间:2022/3/25 15:56:00 -- 有办法解决吗? |
-- 作者:有点蓝 -- 发布时间:2022/3/25 16:07:00 -- Dim rt As New prt.RenderTable rt.Style.Spacing.Top = 5
|