以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  表格在报表中如何居中  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=137455)

--  作者:hqy168168
--  发布时间:2019/7/6 13:23:00
--  表格在报表中如何居中
\'\'\'\'要报表中的表格在报表中居中,如何搞?

Dim doc As New PrintDoc()
Doc.PageSetting.LeftMargin = 18
Doc.PageSetting.RightMargin = 18
Doc.PageSetting.TopMargin = 25
Doc.PageSetting.BottomMargin = 25
doc.PageSetting.PaperKind = 9

Dim FenMianRx As New prt.RenderText
FenMianRx.Text = "用户信息"
FenMianRx.Style.TextAlignHorz = prt.AlignHorzEnum.Center
FenMianRx.Style.Font = New Font("华文中宋",36,FontStyle.Bold)


Dim FenMianRt As New prt.RenderTable()
FenMianRt.Style.Spacing.Top = 20
FenMianRt.Rows.Count = 3
FenMianRt.Cols.Count = 2

Dim FenMianRx00 As New prt.RenderText
FenMianRx00.Text = "客户姓名:"
FenMianRt.Cells(0,0).RenderObject = FenMianRx00 \'放置在单元格中
Dim FenMianRx10 As New prt.RenderText
FenMianRx10.Text = "身份证号:"
FenMianRt.Cells(1,0).RenderObject = FenMianRx10
Dim FenMianRx20 As New prt.RenderText
FenMianRx20.Text = "联系电话:"
FenMianRt.Cells(2,0).RenderObject = FenMianRx20

For i As Integer = 0 To 2
    FenMianRt.Rows(i).Height = 12
    FenMianRt.Cells(i,1).Style.Borders.Bottom = New prt.Linedef()
Next
FenMianRt.Width = 90
FenMianRt.Cols(0).Width = 25
FenMianRt.Cols(1).Width = 60
FenMianRt.Cols(0).Style.Font = New Font("宋体",12,FontStyle.Bold)
FenMianRt.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Right
FenMianRt.Cols(0).Style.TextAlignVert = prt.AlignVertEnum.Bottom
FenMianRt.Cols(1).Style.Font = New Font("华文楷体",12)
FenMianRt.Cols(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
FenMianRt.Cols(1).Style.TextAlignVert = prt.AlignVertEnum.Bottom
doc.Body.Children.Add(FenMianRx)
doc.Body.Children.Add(FenMianRt)
doc.Preview()

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


--  作者:有点蓝
--  发布时间:2019/7/6 14:12:00
--  

FenMianRt.x = (val(doc.PageSetting.width) - val(FenMianRt.Width)  - val(doc.PageSetting.LeftMargin))/2