以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  专业报表中,如何设置页眉的左边距和顶边距  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114610)

--  作者:lihe60
--  发布时间:2018/2/11 10:04:00
--  专业报表中,如何设置页眉的左边距和顶边距
如题
--  作者:lihe60
--  发布时间:2018/2/11 10:36:00
--  
这个不能设置吗?
--  作者:有点蓝
--  发布时间:2018/2/11 10:50:00
--  

Dim doc As New PrintDoc \'定义一个报表
Dim rt As New prt.RenderText \'定义一个文本对象
Doc.PageSetting.LeftMargin = 10 \'设置左边距
Doc.PageSetting.RightMargin = 10 \'设置右边距
Doc.PageSetting.TopMargin = 20 \'设置上边距
Doc.PageSetting.BottomMargin = 20 \'设置下边距
rt.Width = "Parent.Width" \'对象宽度等于页面宽度
rt.Height = "Parent.Height" \'对象高度等于页面高度
rt.Style.Borders.All = New prt.Linedef(1, Color.Red) \'设置边框
doc.Body.Children.Add(rt) \'将文本对象加入到报表
rt = New prt.RenderText \'设置文本对象的内容
rt.Text = "第[PageNo]页,共[PageCount]页" \'设置文本内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.left \'靠右对齐
rt.Style.Borders.Bottom = New prt.LineDef(0.3, Color.Green) \'设置底边框
rt.Style.Padding.left = -10
rt.Style.Padding.Bottom = 10 \'底端内容缩进0.5毫米
rt.Style.FontSize = 12 \'字体大小为8磅
Doc.PageHeader = rt \'作为页眉使用
doc.Preview() \'预览