Dim doc As New PrintDoc '定义一个报表 doc.PageSetting.PaperKind = 9 '定义纸张为A4 'Dim Currow As Row 'Dim tbl As Table = Tables("卷宗封面") 'For i As Integer = tbl.TopRow To tbl.BottomRow 'CurRow = tbl.rows(i) For i As Integer = 1 To 2 Dim ra As New prt.RenderArea '定义一个文本对象 ra.Height = 130 '对象高度为192毫米 Doc.PageSetting.TopMargin = 10 '设置上边距 Doc.PageSetting.LeftMargin = 25 '设置左边距 Doc.PageSetting.RightMargin=25 ''Doc.PageSetting.BottomMargin = 53 '设置下边距 ra.Style.Borders.All = New prt.Linedef(1, Color.black) Doc.Body.Children.Add(ra) Dim rt2 As New prt.RenderTable() '定义一个表格对象 rt2.Style.Borders.all = New prt.Linedef(0.1, Color.white, DashStyle.Dot) rt2.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型 rt2.Style.TextAlignHorz = prt.AlignHorzEnum.Center rt2.Style.TextAlignVert = prt.AlignVertEnum.Center rt2.Cells(0,0).Style.Font = New Font("宋体", 28 , FontStyle.Bold) '设置文本对象的字体 rt2.Cells(1,0).Style.Font = New Font("宋体", 20 , FontStyle.Bold) '设置文本对象的字体 rt2.Style.Font = New Font("宋体", 16, FontStyle.Bold) rt2.Cols.Count = 2 '设置列数 rt2.Rows.Count = 8 '设置行数 rt2.Height = "128" '设置表格的高度 rt2.Width = "128" '设置表格的宽度 rt2.Style.Padding.Top = 0.5 '上边距25毫米 rt2.Style.Padding.Left = 0.5 '左边距5毫米 rt2.Style.Padding.Right = 0.5 '右边距5毫米 rt2.Style.Padding.Bottom= 0.5 '左边距5毫米 rt2.Cols(0).Width = 30 '设置列宽 rt2.Cells(0,0).SpanCols = 2 rt2.Cells(1,0).SpanCols = 2 rt2.Cells(0,0).Text="贵州省瓮安县人民检察院" rt2.Cells(1,0).Text="贵州省瓮安县人民检察院" rt2.Cells(2,0).Text="讯问时间:" rt2.Cells(3,0).Text="讯问地点:" rt2.Cells(4,0).Text="案件编号:" rt2.Cells(5,0).Text="录制编号:" rt2.Cells(6,0).Text="光盘编号:" rt2.Cells(7,0).Text="录制人员:" ra.Children.Add(rt2) '将文本对象加入到报表 Dim rt3 As New prt.RenderTable() '定义一个表格对象 rt3.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型 rt3.Rows.Count = 8 '设置行数 rt3.Cols.Count = 4 '设置列数 rt3.Height = "127" '设置表格的高度 rt3.Width = "162" '设置表格的宽度 rt3.Cells(0,1).Text="贵州省瓮安县人民检察院" rt3.Cells(1,1).Text="贵州省瓮安县人民检察院" rt3.Cells(2,1).Text="讯问时间:" rt3.Cells(3,1).Text="讯问地点:" rt3.Cells(4,1).Text="案件编号:" rt3.Cells(5,1).Text="录制编号:" rt3.Cells(6,1).Text="光盘编号:" rt3.Cells(7,1).Text="录制人员:" rt3.Cells(0,0).Text="贵州省瓮安县人民检察院" rt3.Cells(0,0).Style.TextAngle = -360 rt3.Cells(0,3).Text="贵州省瓮安县人民检察院" rt3.Cells(0,3).Style.TextAngle = -360 rt3.Style.TextAlignHorz = prt.AlignHorzEnum.Center rt3.Style.TextAlignVert = prt.AlignVertEnum.Center rt3.Style.Font = New Font("宋体", 16, FontStyle.Bold) rt3.Cells(0,1).Style.Font = New Font("宋体", 23 , FontStyle.Bold) '设置文本对象的字体 rt3.Cols(0).Width = 8 '设置列宽 rt3.Cols(1).Width = 30 'rt3.Cols(2).Width = 6 rt3.Cols(3).Width = 8 'rt3.Style.Padding.Top = 5 '上边距25毫米 'rt3.Style.Padding.Right = 25 '右边距5毫米 rt3.y = 140 '表水平位置 rt3.Cells(0,1).SpanCols = 2 rt3.Cells(1,1).SpanCols = 2 rt3.Cells(0,0).SpanRows = 8 rt3.Cells(0,3).SpanRows = 8 doc.Body.Children.Add(rt3) Dim rt4 As New prt.RenderTable() '定义一个表格对象 rt4.Style.Borders.all = New prt.Linedef(0.1, Color.white, DashStyle.Dot) rt4.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型 rt4.Style.TextAlignHorz = prt.AlignHorzEnum.Center rt4.Style.TextAlignVert = prt.AlignVertEnum.Center rt4.Cells(0,0).Style.Font = New Font("宋体", 28 , FontStyle.Bold) '设置文本对象的字体 rt4.Cells(1,0).Style.Font = New Font("宋体", 20 , FontStyle.Bold) '设置文本对象的字体 rt4.Style.Font = New Font("宋体", 16, FontStyle.Bold) rt4.Cols.Count = 2 '设置列数 rt4.Rows.Count = 8 '设置行数 rt4.Height = "128" '设置表格的高度 rt4.Width = "128" '设置表格的宽度 rt4.Style.Padding.Top = 0.5 '上边距25毫米 rt4.Style.Padding.Left = 0.5 '左边距5毫米 rt4.Style.Padding.Right = 0.5 '右边距5毫米 rt4.Style.Padding.Bottom= 0.5 '左边距5毫米 rt4.Cols(0).Width = 30 '设置列宽 rt4.Cells(0,0).SpanCols = 2 rt4.Cells(1,0).SpanCols = 2 rt4.Cells(0,0).Text="贵州省瓮安县人民检察院" rt4.Cells(1,0).Text="贵州省瓮安县人民检察院" rt4.Cells(2,0).Text="讯问时间:" rt4.Cells(3,0).Text="讯问地点:" rt4.Cells(4,0).Text="案件编号:" rt4.Cells(5,0).Text="录制编号:" rt4.Cells(6,0).Text="光盘编号:" rt4.Cells(7,0).Text="录制人员:" ra.Children.Add(rt4) '将文本对象加入到报表 Dim rt5 As New prt.RenderTable() '定义一个表格对象 rt5.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型 rt5.Rows.Count = 8 '设置行数 rt5.Cols.Count = 4 '设置列数 rt5.Height = "127" '设置表格的高度 rt5.Width = "162" '设置表格的宽度 rt5.Cells(0,1).Text="贵州省瓮安县人民检察院" rt5.Cells(1,1).Text="贵州省瓮安县人民检察院" rt5.Cells(2,1).Text="讯问时间:" rt5.Cells(3,1).Text="讯问地点:" rt5.Cells(4,1).Text="案件编号:" rt5.Cells(5,1).Text="录制编号:" rt5.Cells(6,1).Text="光盘编号:" rt5.Cells(7,1).Text="录制人员:" rt5.Cells(0,0).Text="贵州省瓮安县人民检察院" rt5.Cells(0,0).Style.TextAngle = -360 rt5.Cells(0,3).Text="贵州省瓮安县人民检察院" rt5.Cells(0,3).Style.TextAngle = -360 rt5.Style.TextAlignHorz = prt.AlignHorzEnum.Center rt5.Style.TextAlignVert = prt.AlignVertEnum.Center rt5.Style.Font = New Font("宋体", 16, FontStyle.Bold) rt5.Cells(0,1).Style.Font = New Font("宋体", 23 , FontStyle.Bold) '设置文本对象的字体 rt5.Cols(0).Width = 8 '设置列宽 rt5.Cols(1).Width = 30 'rt5.Cols(2).Width = 6 rt5.Cols(3).Width = 8 'rt5.Style.Padding.Top = 5 '上边距25毫米 'rt5.Style.Padding.Right = 25 '右边距5毫米 'rt5.y = 142 '表水平位置 rt5.Cells(0,1).SpanCols = 2 rt5.Cells(1,1).SpanCols = 2 rt5.Cells(0,0).SpanRows = 8 rt5.Cells(0,3).SpanRows = 8 doc.Body.Children.Add(rt5) If i Mod 2 = 0 Then ra.Style.Spacing.Left = 35 ra.Width = 161 '对象宽度为163毫米 Else ra.Style.Spacing.Left = 0 ra.Width = 130 '对象宽度为163毫米 End If If i < 2 Then rt5.BreakAfter = prt.BreakEnum.Page End If Next doc.Preview() '预览
|