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
rt.Style.Spacing.All = 0
'指定行数?列数?列宽?行高
rt.Rows.Count = 5 '设置总行数
rt.Cols.Count = 2 '设置总列数
rt.Height = 30 '设置表格的高度
rt.Cols(0).Width = 15 '设置前列的宽度
rt.CellStyle.padding.Top = 2 '单元格内容缩进
rt.Style.WordWrap=True '内容垂直居中
rt.Cells(0,0).Text= "试剂名称"
rt.Cells(0,1).Text ="开始大幅"
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,1).Text ="开始大幅"
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 ="开始大幅"
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 ="开始大幅"
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 ="开始大幅"
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) '将表格对象加入到报表中
Doc.Preview