以文本方式查看主题

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

--  作者:douglas738888
--  发布时间:2015/8/13 14:15:00
--  报表标题的问题
请教老师,怎样把标题放在表格上部,看了帮助感觉还是有些混淆和迷糊了,谢谢!!
以下代码,是标题在表格下部显示的。

Dim n As New prt.RenderText \'定义一个文本对象
n.Text = "客户统计报表" \'设置文本对象的内容
n.Style.Font = New Font("黑体", 24 , FontStyle.Bold) \'设置文本对象的字体
n.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'文本内容水平居中
Dim doc As New PrintDoc \'定义一个新报表
Dim rt As New prt.RenderTable() \'定义一个新表格
Dim tb As Table = Tables("主窗口_Table5")
doc.PageSetting.Landscape = True \'横向打印
rt.Width = "Auto" \'表格宽度为自动,也就是等于各列设置宽度之和
rt.SplitHorzBehavior = prt.SplitBehaviorEnum.SplitIfNeeded \'表格宽度超出页宽时,可以水平换页
rt.Style.Font = tb.Font
For c As Integer = 0 To tb.Cols.Count -1 \'逐列设置和填入内容
    rt.Cells(0,c).Text = tb.Cols(c).Name \'列名作为标题
    rt.Cells(0,c).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'标题内容水平居中
    rt.Cols(c).Width = tb.Cols(c).PrintWidth \'列宽等于实际列宽
    rt.Style.Spacing.Top = 20 \'表格和前面对象的垂直间隔为毫米
    rt.Style.Spacing.Bottom = 10 \'表和和前对象的垂直间隔为10毫米
    If tb.Cols(c).IsNumeric OrElse tb.Cols(c).IsDate Then \'如果是数值或日期列
        rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'数据水平靠右
    End If
    For r As Integer = 0 To tb.Rows.Count -1 \'开始填入该列内容
        rt.Cells(r + 1, c).Text = tb(r,c)
        rt.Rows(0).Height = 7 \'设置行高

doc.Body.Children.Add(n) \'将文本对象加入到报表

doc.Preview()

[此贴子已经被作者于2015/8/13 14:17:59编辑过]

--  作者:douglas738888
--  发布时间:2015/8/13 14:20:00
--  
已解决了!!!!