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 = 180 '表宽为90毫米
rt.Height = 180 '表高为90毫米
rt.Rows.Count = 10 '设置行数
rt.Cols.Count = 10 '设置列数
Dim Line As New prt.LineDef(0.1, Color.Blue, DashStyle.Dash)
Dim ra As prt.RenderArea
Dim rx As prt.RenderText
For i As Integer = 0 To 9
For j As Integer = 0 To 9
ra = rt.Cells(i,j).Area
Dim ln As New prt.RenderLine(0,0,1,1,Line)
ln.Width = "Parent.Width"
ln.Height = "Parent.Width"
ra.Children.Add(ln)
ln = New prt.RenderLine(1,0,0,1,Line)
ln.Width = "Parent.Width"
ln.Height = "Parent.Width"
ra.Children.Add(ln)
ln = New prt.RenderLine(1,0,1,1,Line)
ln.Width = "Parent.Width"
ln.Height = "Parent.Width"
ra.Children.Add(ln)
ln = New prt.RenderLine(0,1,1,1,Line)
ln.Width = "Parent.Width"
ln.Height = "Parent.Width"
ra.Children.Add(ln)
rx = New prt.RenderText
rx.Text = "狐"
rx.Style.FontSize = 45
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rx.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
ra.Children.Add(rx)
Next
Next
Doc.Preview() '预览报表