加一句代码就行了
Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim CurRow As Row = Tables("支piao").Current
Dim tbl As Table = Tables("支piao")
For i As Integer = tbl.TopRow To tbl.BottomRow
If currow("支piao类型") = "现金支piao" Then
doc.PageSetting.Width = 230 '纸张宽度为230毫米
doc.PageSetting.Height = 80 '纸张高度为100毫米
Doc.PageSetting.LeftMargin = 10
Doc.PageSetting.TopMargin = 10
Doc.PageSetting.RightMargin = 10
Doc.PageSetting.BottomMargin = 10
doc.AutoRotate = False
rx = new prt.RenderText
rx.Text = CUNum(CurRow("日期").year)
Dim dr1 As DataRow = DataTables("调整").DataRows(0)
Dim dy1 As Integer = dr1("左")
Dim du1 As Integer = dr1("上")
rx.x = dy1
rx.y = du1
doc.body.Children.Add(rx)
Doc.Preview() '预览报表1
ElseIf currow("支piao类型") = "转账支piao" Then
doc.PageSetting.Width = 230 '纸张宽度为230毫米
doc.PageSetting.Height = 180 '纸张高度为100毫米
Doc.PageSetting.LeftMargin = 10
Doc.PageSetting.TopMargin = 10
Doc.PageSetting.RightMargin = 10
Doc.PageSetting.BottomMargin = 10
doc.AutoRotate = False
rx = new prt.RenderText
rx.Text = CUNum(CurRow("日期").year)
Dim dr1 As DataRow = DataTables("调整").DataRows(0)
Dim dy1 As Integer = dr1("左")
Dim du1 As Integer = dr1("上")
rx.x = dy1
rx.y = du1
doc.body.Children.Add(rx)
doc.Preview() '预览报表2
doc = new PrintDoc
doc.PageSetting.Width = 200 '纸张宽度为200毫米
doc.PageSetting.Height = 150 '纸张高度为150毫米
Doc.PageSetting.LeftMargin = 10
Doc.PageSetting.TopMargin = 10
Doc.PageSetting.RightMargin = 10
Doc.PageSetting.BottomMargin = 10
doc.AutoRotate = False
rx = new prt.RenderText
rx.Text = CurRow("日期").year
Dim dr18 As DataRow = DataTables("调整").DataRows(0)
Dim dy18 As Integer = dr18("左")
Dim du18 As Integer = dr18("上")
rx.x = dy18
rx.y = du18
doc.body.Children.Add(rx)
doc.Preview() '预览报表3
End If
Next