-- 作者:mamuaiqing
-- 发布时间:2013/7/10 0:09:00
-- 上传个支piao套打给论坛里需要的狐友
好不容易研究出来支票套打,拿到银行里说支票内容只能手写不能打印,勒了个去,上传代码给论坛里需要的狐友
代码以专业报表形式,项目很简单就不上传了,好象论坛里也有这方面代码,代码是以农业银行支票格式进行套打的,建议打印机为喷墨打印机或激光打印机,报表为预缆后再执行
打印,上传先
Dim doc As New PrintDoc \'定义一个报表 Dim rx As prt.RenderText \'定义一个文本对象 Dim rm As prt.RenderImage \'定义一个图形队形 Dim CurRow As Row = Tables("支票").Current doc.PageSetting.Landscape = True \'横向打印 doc.PageSetting.Width = 226 \'纸张宽度为100毫米 doc.PageSetting.Height = 80 \'纸张高度为120毫米 Doc.PageSetting.LeftMargin = 0 \'设置左边距 Doc.PageSetting.RightMargin = 0 \'设置右边距 Doc.PageSetting.TopMargin = 0 \'设置上边距 Doc.PageSetting.BottomMargin = 0 \'设置下边距
rx = new prt.RenderText rx.Text = CurRow("收款人") rx.Style.FontSize = 10 \'字体大小为16磅 rx.x = 78 rx.y = 20.5 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CUNum(CurRow("日期").Year) rx.x = 92 rx.y = 15 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CCNumber(CurRow("日期").Month) rx.x = 113 rx.y = 15 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CCNumber(CurRow("日期").Day) rx.x = 129 rx.y = 15 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CUMoney(CurRow("金额")) rx.Style.FontSize = 16 \'字体大小为16磅 rx.x = 79 rx.y = 26 doc.body.Children.Add(rx) If GetDigit(CurRow("金额"),8) > "" Then rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),8) rx.x = 171 rx.y = 30 doc.body.Children.Add(rx) End If If GetDigit(CurRow("金额"),7) > "" Then rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),7) rx.x = 175 rx.y = 30 doc.body.Children.Add(rx) End If If GetDigit(CurRow("金额"),6) > "" Then rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),6) rx.x = 179 rx.y = 30 doc.body.Children.Add(rx) End If If GetDigit(CurRow("金额"),5) > "" Then rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),5) rx.x = 183 rx.y = 30 doc.body.Children.Add(rx) End If
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),4) rx.x = 187 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),3) rx.x = 191 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),2) rx.x = 195 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),1) rx.x = 199 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),0) rx.x = 203.2 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),-1) rx.x = 207 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = GetDigit(CurRow("金额"),-2) rx.x = 211 rx.y = 30 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("用途") rx.Style.FontSize = 12 \'字体大小为16磅 rx.x = 76 rx.y = 36 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("日期").Year rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 25 rx.y = 43 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("日期").Month rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 36 rx.y = 43 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("日期").Day rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 45 rx.y = 43 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("收款人") rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 13 rx.y = 54 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("金额") rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 24 rx.y = 60 doc.body.Children.Add(rx)
rx = new prt.RenderText rx.Text = CurRow("用途") rx.Style.FontSize = 8 \'字体大小为16磅 rx.x = 24 rx.y = 65 doc.body.Children.Add(rx) Doc.Preview() \'预览报表
|