Dim doc As New PrintDoc \'定义一个报表
Dim rt As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(rt) \'将表格对象加入到报表中
rt.Style.GridLines.All = New prt.Linedef \'设置网格线
rt.Cols.Count = 3
Dim rx As New prt.RenderText
rx.Text = "品名"
rt.Cells(0,0).RenderObject = rx
rx = New prt.RenderText
rx.Text = "货号"
rt.Cells(0,1).RenderObject = rx
rx = New prt.RenderText
rx.Text = "数量"
rt.Cells(0,2).RenderObject = rx
rt.Cells(1,0).SpanCols = 3
rx = New prt.RenderText
rx.Text = "苹果苹果股票苹果"
rt.Cells(1,0).RenderObject = rx
rt.Cells(2,0).SpanCols = 2
rx = New prt.RenderText
rx.Text = "0123456789"
rt.Cells(2,0).RenderObject = rx
rt.Cells(2,0).SpanCols = 2 \'
rx = New prt.RenderText
rx.Text = "1"
rt.Cells(2,2).RenderObject = rx
rt.Style.TextAlignHorz =prt.AlignHorzEnum.Center
Doc.Preview() \'预览报表