以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  专业报表救助  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=139310)

--  作者:yifan3429
--  发布时间:2019/8/10 19:52:00
--  专业报表救助
Dim doc As New PrintDoc \'定义一个报表
Dim rt As prt.RenderText \'定义一个文本对象
Dim s As String
Dim dr As String = Tables("公司架构").Current
s = dr("公司名称")
s = dr("部门")
For i As Integer = 1 To 20
    rt = New prt.RenderText
    rt.Text = s \'设置文本对象的内容
    rt.Style.TextIndent = 9 \'首行缩进9毫米
    rt.Style.Spacing.Top = 5 \'每段间隔5毫米
    rt.Style.LineSpacing = 150 \'1.5倍行距
    doc.Body.Children.Add(rt) \'将文本对象加入到报表
Next
\'设置页眉
rt = New prt.RenderText \'设置文本对象的内容
rt.Text = "第[PageNo]页,共[PageCount]页" \'设置文本内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Right \'靠右对齐
rt.Style.Borders.Bottom = New prt.LineDef(0.3, Color.Green) \'设置底边框
rt.Style.Padding.Bottom = 0.5 \'底端内容缩进0.5毫米
rt.Style.FontSize = 8 \'字体大小为8磅
Doc.PageHeader = rt \'作为页眉使用
doc.Preview() \'预览

希望达到WODR的这个效果


图片点击可在新窗口打开查看此主题相关图片如下:企业微信截图_20190810195148.png
图片点击可在新窗口打开查看




[此贴子已经被作者于2019/8/10 19:53:02编辑过]

--  作者:有点蓝
--  发布时间:2019/8/11 21:10:00
--  
例如

Dim doc As New PrintDoc \'定义一个报表
Dim rt As prt.RenderText \'定义一个文本对象
Dim s As String
Dim dr As String = Tables("公司架构").Current
s = dr("公司名称") & dr("部门") & “职责”
rt = New prt.RenderText
    rt.Text = s \'设置文本对象的内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
rt.Style.Font = New Font(
"宋体"16, FontStyle.Bold) \'设置字体
doc.Body.Children.Add(rt) \'将文本对象加入到报表

rt = New prt.RenderText
rt = “岗位ID:” & dr("岗位ID")
rx.x = 51
rx.y = 
10
doc.Body.Children.Add(rt) \'将文本对象加入到报表

rt = New prt.RenderText
rt = “岗位职责:” & dr("岗位职责")
rx.x = 71
rx.y = 2
0
doc.Body.Children.Add(rt) \'将文本对象加入到报表
……