Foxtable(狐表)用户栏目专家坐堂 → 表格在报表中如何居中


  共有2824人关注过本帖树形打印复制链接

主题:表格在报表中如何居中

帅哥哟,离线,有人找我吗?
hqy168168
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:252 积分:3424 威望:0 精华:0 注册:2012/7/20 12:15:00
表格在报表中如何居中  发帖心情 Post By: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
图片点击可在新窗口打开查看


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110581 积分:562801 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/6 14:12:00 [只看该作者]


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

 回到顶部