Dim r As Row = Tables ("收据信息" ). Current
With Tables ( "收据打印参数" )
Dim pyz As Integer = . rows (0 )( "整体偏移_X" ) '取左偏移的值....
Dim pys As Integer = . rows (0 )( "整体偏移_Y" ) '取上偏移的值....
Dim doc As New PrintDoc '定义一个报表
Dim text As new prt .RenderText
Doc .PrinterName = . Rows( 0 )("打印机" )
Doc .PageSetting . LeftMargin= 1
Doc .PageSetting . BottomMargin = 1
Doc .PageSetting . TopMargin= 1
Doc .PageSetting . LeftMargin = 1
doc .PageSetting . Width = val (.Rows ( 0)( "宽度" )) '纸张宽度为100毫米
doc .PageSetting . Height = val (.Rows ( 0)( "高度" )) '纸张高度为120毫米
'----------------------------------
Dim skr As New prt .RenderText '开piao日期
kprq .Text = r ( "开piao日期" )
kprq .X = val (. rows( 0 )("开piao日期_X" )) + pyz
kprq .y = val (. rows( 0 )("开piao日期_Y" )) + pys
doc .body .Children . Add( kprq )
'----------------------------------
Dim skr As New prt .RenderText '缴款单位
jkdw .Text = r ( "缴款单位或个人" )
jkdw .X = val (. rows( 0 )("缴款单位或个人_X" )) + pyz
jkdw .y = val (. rows( 0 )("缴款单位或个人_Y" )) + pys
doc .body .Children . Add( jkdw )
'----------------------------------
Dim skr As New prt .RenderText '款项内容
kxnr .Text = r ( "款项内容" )
kxnr .X = val (. rows( 0 )("款项内容_X" )) + pyz
kxnr .y = val (. rows( 0 )("款项内容_Y" )) + pys
doc .body .Children . Add( kxnr )
'----------------------------------
Dim skr As New prt .RenderText '款项其他内容
kxqtnr .Text = r ( "款项其他内容" )
kxqtnr .X = val (. rows( 0 )("款项其他内容_X" )) + pyz
kxqtnr .y = val (. rows( 0 )("款项其他内容_Y" )) + pys
doc .body .Children . Add( kxqtnr )
'----------------------------------
Dim skr As New prt .RenderText '收款方式
skfs .Text = r ( "收款方式" )
skfs .X = val (. rows( 0 )("收款方式_X" )) + pyz
skfs .y = val (. rows( 0 )("收款方式_Y" )) + pys
doc .body .Children . Add( skfs )
'----------------------------------
Dim fksj1 As New prt .RenderText ' 收款金额
skje .Text = r ( "收款金额" )
skje .X = val (. rows( 0 )("收款金额_X" )) + pyz
skje .y = val (. rows( 0 )("收款金额_Y" )) + pys
doc .body .Children . Add( skje )
'----------------------------------
Dim je As New prt .RenderText '人民币大写
dxje .Style . Font = New Font ("宋体" , 12)
dxje .Text = CUMoney ( r( "大写金额" ))
dxje .X = val (. rows( 0 )("人民币大写_X" )) + pyz
dxje .y = val (. rows( 0 )("人民币大写_Y" )) + pys
doc .body .Children . Add( dxje )
'----------------------------------
Dim skr As New prt .RenderText '收款人
skr .Text = r ( "收款人" )
skr .X = val (. rows( 0 )("收款人_X" )) + pyz
skr .y = val (. rows( 0 )("收款人_Y" )) + pys
doc .body .Children . Add( skr )
'----------------------------------
Dim skr As New prt .RenderText '备注
bz .Text = r ( "备注")
bz .X = val (. rows( 0 )("备注_X" )) + pyz
bz .y = val (. rows( 0 )("备注_Y" )) + pys
doc .body .Children . Add( bz )
doc .AutoRotate = False
Doc .Print
End With