Dim doc As New Printdoc '定义一个报表
doc.PageSetting.PaperKind = 9 '纸张类型改为A4
doc.PageSetting.Landscape = True '横向打印
doc.PageSetting.LeftMargin = 25 '设置左边距
doc.PageSetting.RightMargin = 22 '设置右边距
doc.PageSetting.TopMargin = 25 '设置上边距
doc.PageSetting.BottomMargin = 20 '设置下边距
'For Each dr As DataRow In DataTables("bymc").Select("[校名] = '安胜小学'")
Dim rt As prt.RenderText '定义一个文本对象
rt = New prt.RenderText() '创建文本对象
rt.Text = "附件3:" '设置文本对象的内容
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 16 '字体大小为16磅
rt.Style.TextAlignHorz = prt.AlignHorzEnum.left
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "梁平县中招体育考试成绩登记表" '设置文本对象的内容
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 20 '字体大小为16磅
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "区 县:梁平县" '设置文本对象的内容
rt.X = 24
rt.Y = 55
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "考 场:" '& dr("校名") '设置文本对象的内容
rt.X = 120
rt.Y = 55
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "考生照片" '设置文本对象的内容
rt.X = 245
rt.Y = 38
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
rt.Width = 25 '宽度为40毫米
rt.Height = 35 '宽度为40毫米
rt.Style.Borders.All = New prt.Linedef(0.3, Color.Black) '设置边框
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "学 校:" '& dr("校名") '设置文本对象的内容
rt.X = 24
rt.Y = 62
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "准考证号:" '& dr("校名") '设置文本对象的内容
rt.X = 24
rt.Y = 68
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "姓 名:" '& dr("校名") '设置文本对象的内容
rt.X = 120
rt.Y = 68
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "性 别:" '& dr("校名") '设置文本对象的内容
rt.X = 190
rt.Y = 68
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
Dim bg As New prt.RenderTable() '定义一个表格对象
bg.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
bg.x = 25
bg.y = 75
rt.Width = 258 '设置表格的宽度为258毫米
bg.Height = 90 '
bg.Rows.Count = 5 '设置行数
bg.Cols.Count = 9 '设置列数
For i As Integer = 0 To 9
bg.Cols(i).Width = 24
Next
bg.Rows(0).Height = 14 '设置行高
bg.Rows(1).Height = 14 '设置行高
bg.Rows(2).Height = 20 '设置行高
bg.Rows(3).Height = 20 '设置行高
bg.Rows(4).Height = 20 '设置行高
bg.Cells(0,0).SpanRows = 2 '第1行第1个单元格向下合并2行
bg.Cells(0,1).SpanCols = 3 '第1行第2个单元格向右合并3列
bg.Cells(0,4).SpanCols = 2 '第1行第5个单元格向右合并2列
bg.Cells(0,6).SpanCols = 4 '第1行第7个单元格向右合并3列
bg.Cells(2,7).SpanRows = 3 '第2行第8个单元格向下合并3行
bg.Cells(4,1).SpanCols = 3 '第5行第1个单元格向右合并3列
bg.cells(0,0).Text = "项目"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(0,1).Text = "成 绩"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(0,4).Text = "最高(终)成绩"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(0,6).Text = "最后得分"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,1).Text = "第一次(表)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,2).Text = "第二次(表)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,3).Text = "第三次(表)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,4).Text = "成绩"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,5).Text = "考生签名"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,6).Text = "单项得分"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,7).Text = "三项总得分"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,8).Text = "登分员签名"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(1,9).Text = "考务组长签名"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(2,0).Text = "立定跳远(米)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(3,0).Text = "掷实心球(米)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.cells(4,0).Text = "一分钟跳绳(次)"
rt.Style.F
bg.Style.FontBold = False'字体加粗
bg.Style.FontSize = 14 '字体大小为16磅
bg.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
bg.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
doc.Body.Children.Add(bg) '将表格对象加入到报表中
rt = New prt.RenderText() '创建文本对象
rt.Text = "注:此表为考生原始成绩记录,是输入微机的依据,必须用钢笔填写,不许交考生和无关人员.每项成绩考试后,考生当场签字." '& dr("校名") '设置文本对象的内容
rt.X = 25
rt.Y = 165
rt.Style.TextIndent = 8
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "微机处理后,中招体考成绩入考生升学总分,再将该表装入考生升学档案." '& dr("校名") '设置文本对象的内容
rt.X = 25
rt.Y = 175
rt.Style.TextIndent = 8
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText() '创建文本对象
rt.Text = "梁平县中招办盖章" '& dr("校名") '设置文本对象的内容
rt.X = 200
rt.Y = 180
rt.Style.TextIndent = 8
rt.Style.F
rt.Style.FontBold = False'字体加粗
rt.Style.FontSize = 14 '字体大小为16磅
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText '设置文本对象的内容 ' 设置水印
rt.Text = "梁平中招体育考试专用表" '设置文本内容
rt.Width = "Parent.Width" '宽度等于页面宽度
rt.Height = "Parent.Height" '高度等于页面高度
rt.Style.F
rt.Style.FontBold = True '字体加粗
rt.Style.FontSize = 22 '字体大小为8磅
rt.Style.TextAngle = 20 '旋转20度
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中对齐
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中对齐
rt.Style.TextColor = Color.Gray '文本颜色为灰色
Doc.WaterMark = rt '作为页眉使用
'Next
doc.Preview() '预览