bg.Cells(2,0).text = "基本信息" '通过左边空格数量来调整副标题位置
bg.Cells(2,0).SpanCols = 3 '合并地二行全部单元格,用于显示副标题
bg.Cells(2,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置主标题字体
bg.Cells(2,0).Style.TextAlignHorz = prt.AlignHorzEnum.left '副标题内容居中
bg.Cells(2,3).text = "卷宗编号"
bg.Cells(2,3).Style.TextAlignHorz = prt.AlignHorzEnum.right '副标题内容居中
bg.Cells(2,4).text = currow("卷宗编号") '通过左边空格数量来调整副标题位置
bg.Cells(2,4).SpanCols = 2 '合并地二行全部单元格,用于显示副标题
bg.Cells(2,4).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置主标题字体
bg.Cells(2,4).Style.TextAlignHorz = prt.AlignHorzEnum.Center '副标题内容居中
bg.Rows(2).Style.Borders.All = New prt.LineDef("0mm", Color.white) '去掉第二行的网格线
bg.cells(2,0).Style.Borders.All = New prt.LineDef("0mm", Color.white) '去掉第二行的网格线
bg.cells(2,3).Style.Borders.All = New prt.LineDef("0mm", Color.white) '去掉第二行的网格线
bg.cells(2,3).Style.Borders.Bottom = New prt.Linedef '恢复第二行底端的网格线
bg.cells(2,0).Style.Borders.Bottom = New prt.Linedef '恢复第二行底端的网格线
bg.Rows(2).Style.Borders.Bottom = New prt.Linedef '恢复第二行底端的网格线
bg.Rows(2).Height = 8 '设置第二行的高度,拉开和表格主体的距离.
'设置列标题
bg.Cols(0).Width = 20
bg.Cols(1).Width = 45
bg.Cols(2).Width = 20
bg.Cols(3).Width = 45
bg.Cols(4).Width = 20
bg.Cols(5).Width = 20
bg.Rows.Count = 4
bg.Rows(0).Height = 15
bg.Rows(1).Height = 15
bg.Rows(2).Height = 10
bg.Rows(3).Height = 10
bg.Rows(4).Height = 10
bg.Rows(5).Height = 10
bg.Rows(6).Height = 10
bg.Style.TextAlignHorz = prt.AlignHorzEnum.Center '所有文本内容居中'
bg.Cells(3,0).Text = "所属地州"
bg.Cells(3,1).Text = CurRow("所属地州")
bg.Cells(3,2).Text = "卷宗名称"
bg.Cells(3,3).Text = CurRow("卷宗名称")
bg.Cells(3,4).Text = "涉案款物"
bg.Cells(3,5).Text = CurRow("涉案款物")
bg.Cells(4,0).Text = "所属单位"
bg.Cells(4,1).Text = CurRow("所属单位")
bg.Cells(4,2).Text = "卷宗册数"
bg.Cells(4,3).Text = CurRow("卷宗册数")
bg.Cells(4,4).Text = "款物数量"
bg.Cells(4,5).Text = ndr("款物数量")
bg.Cells(5,0).Text = "承办部门"
bg.Cells(5,1).Text = CurRow("承办部门")
bg.Cells(5,2).Text = "承办人员"
bg.Cells(5,3).Text = CurRow("承办人")
bg.Cells(5,4).Text = "使用人员"
bg.Cells(5,5).Text = CurRow("使用人")
bg.Cells(6,0).Text = "录入时间"
bg.Cells(6,1).Text = CurRow("录入时间")
bg.Cells(6,2).Text = "联系电话"
bg.Cells(6,3).Text = CurRow("联系电话")
bg.Cells(6,4).Text = "办理状态"
bg.Cells(6,5).Text = CurRow("办理状态")
Dim bg1 As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(bg1)
bg1.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
bg1.CellStyle.Spacing.All = 1 '内容距离网格线1毫米
bg1.Width = 160 '表宽为150毫米
'bg1.Height = 50 '表高为150毫米
bg1.Rows.Count = 3 '设置行数
bg1.Cols.Count = 4 '设置列数
bg1.Cells(0,0).text = "卷宗分册信息"
bg1.Cells(0,0).SpanCols = 4 '合并第一行全部单元格,用于显示主标题
bg1.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.left '主标题居中
bg1.Cells(0,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置主标题字体
bg1.Rows(0).Style.Borders.All = New prt.LineDef("0mm", Color.white) '去掉第一行的网格线
bg1.Rows(0).Style.Borders.Bottom = New prt.Linedef '恢复第一行底端的网格线
bg1.Rows(0).Height = 10 '设置第一行的高度,拉开和表格主体的距离.
bg1.Rows(1).Height = 5
bg1.Rows(2).Height = 10
bg1.Cols(0).Width = 50
bg1.Cols(1).Width = 20
bg1.Cols(2).Width = 20
bg1.Cols(3).Width = 20
bg1.Style.TextAlignHorz = prt.AlignHorzEnum.Center '所有文本内容水平居中'
bg1.Style.TextAlignVert = prt.AlignVertEnum.Center '所有文本内容垂直居中'
bg1.Cells(1,0).Text = "卷宗名称"
bg1.Cells(1,1).Text = "卷宗册数"
bg1.Cells(1,2).Text = "分册编号"
bg1.Cells(1,3).Text = "二维码"
For i As Integer = 0 To drs1.count-1
Dim ndr1 = drs1(i)
Dim rm As New prt.RenderImage()
rm.Image = GetImage(ndr1("二维码")) '请改为实际的图标名称和路径
rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center '图片水平居中
rm.Style.ImageAlign.AlignVert = prt.ImageAlignVertEnum.Center '图片垂直居中
rm.Style.ImageAlign.StretchHorz = False '禁止水平方向扩展图片
rm.Style.ImageAlign.StretchVert = False '禁止垂直方向扩展图片
bg1.Cells(2+i,2).RenderObject = rm '将单元格内容设置为图片对象rm
bg1.Rows(2+i).Height = 10
bg1.Cells(2+i,0).Text = ndr1("卷宗名称")
bg1.Cells(2+i,1).Text = ndr1("卷宗册数")
bg1.Cells(2+i,2).Text = ndr1("分册编号")
bg1.Cells(2+i,3).Image = GetImage(ndr1("二维码"))
Next
bg1.Style.Spacing.Top = 30
Dim bg2 As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(bg2)
bg2.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
bg2.CellStyle.Spacing.All = 1 '内容距离网格线1毫米
bg2.Width = 160 '表宽为150毫米
'bg2.Height = 50 '表高为150毫米
bg2.Rows.Count = 3 '设置行数
bg2.Cols.Count = 4 '设置列数
bg2.Cells(0,0).text = "款物序号信息"
bg2.Cells(0,0).SpanCols = 4 '合并第一行全部单元格,用于显示主标题
bg2.Cells(0,0).Style.TextAlignHorz = prt.AlignHorzEnum.left '主标题居中
bg2.Cells(0,0).Style.Font = New Font("宋体", 10, FontStyle.Bold) '设置主标题字体
bg2.Rows(0).Style.Borders.All = New prt.LineDef("0mm", Color.white) '去掉第一行的网格线
bg2.Rows(0).Style.Borders.Bottom = New prt.Linedef '恢复第一行底端的网格线
bg2.Rows(0).Height = 10 '设置第一行的高度,拉开和表格主体的距离.
bg2.Rows(1).Height = 5
bg2.Cols(0).Width = 50
bg2.Cols(1).Width = 20
bg2.Cols(2).Width = 20
bg2.Cols(3).Width = 20
bg2.Style.TextAlignHorz = prt.AlignHorzEnum.Center '所有文本内容水平居中'
bg2.Style.TextAlignVert = prt.AlignVertEnum.Center '所有文本内容垂直居中'
bg2.Cells(1,0).Text = "款物名称"
bg2.Cells(1,1).Text = "款物数量"
bg2.Cells(1,2).Text = "款物序号"
bg2.Cells(1,3).Text = "二维码"
For i As Integer = 0 To drs2.count-1
Dim ndr11 = drs2(i)
bg2.Rows(2+i).Height = 10
bg2.Cells(2+i,0).Text = ndr11("款物名称")
bg2.Cells(2+i,1).Text = ndr11("款物数量")
bg2.Cells(2+i,2).Text = ndr11("款物序号")
bg2.Cells(2+i,3).Image = GetImage(ndr11("二维码"))
Next
bg2.Style.Spacing.Top = 30
'设置页眉
Dim rx As New prt.RenderTable
rx.Cells(0,0).Text = Date.Today
rx.Cells(0,1).Text = " "
rx.Cells(0,2).Text = "第[PageNo]页,共[PageCount]页"
rx.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rx.Cols(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rx.Cols(2).Style.TextAlignHorz = prt.AlignHorzEnum.right
rx.Style.Borders.Bottom = New prt.LineDef '设置底边框
rx.CellStyle.Spacing.Bottom = 0.5 '底端内容缩进0.5毫米
rx.Style.FontSize = 8 '字体大小为8磅
Doc.PageHeader = rx '作为页眉使用
doc.Preview() '预览