这里面的代码如下:是什么原因?
Dim Doc As new PrintDoc()
Dim rt As new prt.rendertable
Dim rx As new prt.RenderText
Dim dt1 As Table=Tables("工程核算_table1")
For i As Integer = dt1.TopRow To dt1.BottomRow
rt = New prt.RenderTable() '定义一个表格对象
rx = New prt.RenderText() '定义一个文本对象
rx.style.Font = new font("宋体",16)
rx.style.TextAlignHorz = prt.AlignHorzEnum.Center
rx.Style.Spacing.Bottom = 3
rx.text = "淇滨区政府投资项目完税情况表" & vblf & vblf & " 单位:元"
Doc.body.Children.Add(rx)
rt.rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '唯独第一列内容居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
'rt.RowGroups(0,1).Style.BackColor = Color.LightGray '第三第四行的颜色设为灰色
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All '前四行作为表头
rt.style.Font = new font("宋体",10)
rt.style.GridLines.all = new prt.LineDef
rt.Cols(3).Width = 25
rt.Cols(4).Width = 25
rt.Cols(5).Width = 15
rt.Rows.Count = 10
rt.Height = 140
rt.width = 265
rt.cells(0,0).text="项目名称"
rt.cells(0,1).text="建设单位"
rt.cells(0,2).text="施工单位"
rt.cells(0,3).text="项目投资额"
rt.cells(0,4).text="本次支付金额"
rt.cells(0,5).text="备注"
Dim dr As Row = dt1.Rows(i)
rt.cells(1,0).text = dr("项目名称")
rt.cells(1,1).text = dr("建设单位")
rt.cells(1,2).text = dr("施工单位")
If dr("已决算金额") = 0 Then
rt.cells(1,3).text= Nothing
Else
rt.cells(1,3).text= Format(dr("已决算金额"),"#,###.00")
End If
If dr("财政核准") = 0 Then
rt.cells(1,4).text= Nothing
Else
rt.cells(1,4).text= Format(dr("财政核准"),"#,###.00")
End If
rt.cells(1,3).Style.TextAlignHorz = prt.AlignHorzEnum.Right
rt.cells(1,4).Style.TextAlignHorz = prt.AlignHorzEnum.Right
Doc.body.Children.Add(rt)
rx = new prt.RenderText
rx.style.Font = new font("宋体",14)
rx.style.TextAlignHorz = prt.AlignHorzEnum.Center
rx.Style.Spacing.Bottom = 3
rx.text = vblf & " 国税部门审核 地税部门审核 "
Doc.body.Children.Add(rx)
Next '
Doc.PageSetting.LeftMargin = 20 '设置左边距
Doc.PageSetting.RightMargin = 10 '设置右边距
Doc.PageSetting.TopMargin = 20 '设置上边距
Doc.PageSetting.BottomMargin = 10 '设置下边距
doc.PageSetting.Landscape = True
Doc.preview()