Dim doc As New PrintDoc '定义一个报表
'设置页面
doc.PageSetting.Width=60
doc.PageSetting.Height=40
doc.PageSetting.LeftMargin=4
doc.PageSetting.TopMargin=4
doc.PageSetting.BottomMargin=4
doc.PageSetting.RightMargin=4
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.FontSize = 7 '大体大小
'字体加粗
rt.style.fontbold=True
rx.Style.Spacing.All = 0
'指定行数?列数?列宽?行高
rt.Rows.Count = 5 '设置总行数
rt.Cols.Count = 2 '设置总列数
rt.Height = 30 '设置表格的高度
rt.Cols(0).Width = 15 '设置前列的宽度
'设置表格样式
rt.CellStyle.Spacing.All = 2 '单元格内容缩进1毫米
rt.Style.WordWrap=True '内容垂直居中
rt.Cells(0,0).Text= "试剂名称"
rt.Cells(0,0).Style.Spacing.Top = 0 '和上面的对象距离
rt.Cells(0,0).Style.Spacing.Bottom = 0 '和下面的对象距离
'rt.cells(0,0).Style.Borders.bottom = New prt.Linedef(0.2, Color.black)
'rt.cells(0,0).Style.Font=New Font("隶书",8,FontStyle.bold)
'rt.cells(0.0).style.Font=New Font("隶书", 10, FontStyle.Bold)
rt.Cells(0,1).Text= Tables("试剂配置").current("试剂名称")
rt.Cells(0,1).Style.Spacing.Top = 0 '
rt.Cells(0,1).Style.Spacing.Bottom = 0 '和下面的对象(表格)距离3毫米'rt.Cells(0,0).Style.TextAlignHorz=prt.AlignHorzEnum.left '水平居中
rt.cells(0,1).Style.Borders.bottom = New prt.Linedef(0.1, Color.black)
rt.Cells(0,1).Style.WordWrap=False
rt.Cells(1,0).Text= "配置浓度"
rt.Cells(1,0).Style.Spacing.Top = 0 '
rt.Cells(1,0).Style.Spacing.Bottom = 0 '和下面的对象(表格)距离3毫米'rt.Cells(0,0).Style.TextAlignHorz=prt.AlignHorzEnum.left '水平居中
rt.Cells(1,1).Text =Tables("试剂配置").current("浓度")
rt.Cells(1,1).Style.Spacing.Top = 0 '
rt.Cells(1,1).Style.Spacing.Bottom = 0 '和下面的对象(表格)距离3毫米'rt.Cells(0,0).Style.TextAlignHorz=prt.AlignHorzEnum.left '水平居中
rt.cells(1,1).Style.Borders.bottom = New prt.Linedef(0.1, Color.black)
rt.Cells(1,1).Style.WordWrap=False
rt.Cells(2,0).Text= "配制人"
rt.Cells(2,1).Text =Tables("试剂配置").current("配制人")
rt.cells(2,1).Style.Borders.bottom = New prt.Linedef(0.1, Color.black)
rt.Cells(2,1).Style.WordWrap=False
rt.Cells(3,0).Text= "配制日期"
rt.Cells(3,1).Text =Tables("试剂配置").current("配制日期")
rt.cells(3,1).Style.Borders.bottom = New prt.Linedef(0.1, Color.black)
rt.Cells(3,1).Style.WordWrap=False
rt.Cells(4,0).Text= "有效日期"
rt.Cells(4,1).Text =Tables("试剂配置").current("有效日期")
rt.cells(4,1).Style.Borders.bottom = New prt.Linedef(0.1, Color.black)
rt.Cells(4,1).Style.WordWrap=False
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Next
Doc.Print()