以文本方式查看主题

-  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=142621)

--  作者:xxfoxtable
--  发布时间:2019/11/1 15:22:00
--  在专业报表,怎么让整体表格在页面中左右居中?
在专业报表,怎么让整体表格在页面中左右居中?
--  作者:有点蓝
--  发布时间:2019/11/1 15:38:00
--  
参考:http://www.foxtable.com/webhelp/topics/1177.htm

Dim doc As New PrintDoc \'定义一个报表
Dim rt As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(rt) \'将表格对象加入到报表中
rt.Style.GridLines.All = New prt.Linedef \'设置网格线
rt.Width = 100
rt.x =  CExp("(Parent.Width - Width) / 2 + {0}", doc.PageSetting.LeftMargin)

\'下面的代码向表格中填入值
For r As Integer = 0 To 5 
    For c As Integer = 0 To 5
        Dim rx As New prt.RenderText \'定义一个文本对象
        rx.Text = r & "," & c \'为文本对象设置内容
        rt.Cells(r, c).RenderObject = rx \'将文本对象放置在单元格中
    Next
Next
doc.Preview() \'预览报表