以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]专业报表中几个字段请教 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=138290) |
||||
-- 作者:lhfu -- 发布时间:2019/7/27 15:00:00 -- [求助]专业报表中几个字段请教 各位老师,我转用专用报表来套打票据中,需要对字体放大、行距、旋转地方代码看不懂,想请教一下的 此主题相关图片如下:截屏图片001.jpg 我是根据帮助文件,这么引用的 Dim doc As New PrintDoc Dim rx As prt.RenderText Dim rm As prt.RenderImage doc.PageSetting.Width = 85 \'纸张宽度为85毫米 doc.PageSetting.Height = 58 \'纸张高度为58毫米 Doc.PageSetting.LeftMargin = 30 \'设置左边距 Doc.PageSetting.RightMargin = 10 \'设置右边距 Doc.PageSetting.TopMargin = 10 \'设置上边距 Doc.PageSetting.BottomMargin = 10 \'设置下边距 rt.Style.TextAngle = 90 \'顺时钟旋转90度 rt.Style.LineSpacing = 200 \'设置双倍行距 rt.Style.Font = New Font("宋体", 16, FontStyle.Bold) Dim Currow As Row Dim tbl As Table = Tables("合格证") For i As Integer = tbl.TopRow To tbl.BottomRow CurRow = tbl.rows(i) Dim rep As New prt.RenderEmpty \'定义一个新的空对象 rep.BreakBefore = prt.BreakEnum.Page \'打印前换页 doc.Body.Children.Add(rep ) \'加入到报表中 rx = new prt.RenderText rx.Text = CurRow("型号") doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("钢号") doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("检验") doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("日期") doc.body.Children.Add(rx) Next Doc.PrinterName = "Canon G1010 series" \'指定的打印机上打印 Doc.Preview() \'预览报表 其中三行,是对字体放大、旋转和调整行行距
[此贴子已经被作者于2019/7/27 15:02:21编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2019/7/27 16:51:00 -- rx = new prt.RenderText rx.Text = CurRow("型号") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 200 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
|
||||
-- 作者:lhfu -- 发布时间:2019/7/27 19:04:00 -- Dim doc As New PrintDoc Dim rx As prt.RenderText Dim rm As prt.RenderImage doc.PageSetting.Width = 85 \'纸张宽度为85毫米 doc.PageSetting.Height = 58 \'纸张高度为58毫米 Doc.PageSetting.LeftMargin = 30 \'设置左边距 Doc.PageSetting.RightMargin = 10 \'设置右边距 Doc.PageSetting.TopMargin = 10 \'设置上边距 Doc.PageSetting.BottomMargin = 10 \'设置下边 Dim rep As New prt.RenderEmpty \'定义一个新的空对象 rep.BreakBefore = prt.BreakEnum.Page \'打印前换页 doc.Body.Children.Add(rep ) \'加入到报表中 Dim Currow As Row Dim tbl As Table = Tables("合格证") For i As Integer = tbl.TopRow To tbl.BottomRow CurRow = tbl.rows(i) rx = new prt.RenderText rx.Text = CurRow("型号") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 200 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) rx = new prt.RenderText rx.Text = CurRow("钢号") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 200 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) Next Doc.PrinterName = "Canon G1010 series" \'指定的打印机上打印 Doc.Preview() \'预览报表 这个修改过后,打印预览是空白的
|
||||
-- 作者:有点蓝 -- 发布时间:2019/7/28 20:42:00 -- Dim doc As New PrintDoc Dim rx As prt.RenderText Dim rm As prt.RenderImage doc.PageSetting.Width = 58 \'纸张宽度为85毫米 doc.PageSetting.Height = 85 \'纸张高度为58毫米 Doc.PageSetting.LeftMargin = 0 \'设置左边距 Doc.PageSetting.RightMargin = 0 \'设置右边距 Doc.PageSetting.TopMargin = 0 \'设置上边距 Doc.PageSetting.BottomMargin = 0 \'设置下边 Dim Currow As Row \'Dim tbl As Table = Tables("合格证") For i As Integer = 0 To 2 \'CurRow = tbl.rows(i) Dim rep As New prt.RenderEmpty \'定义一个新的空对象 rep.BreakBefore = prt.BreakEnum.Page \'打印前换页 doc.Body.Children.Add(rep ) \'加入到报表中 rx = new prt.RenderText rx.x = 10 rx.y = 30 rx.Text = ("型号") rx.Style.TextAngle = -90 \'顺时钟旋转90度 \' rx.Style.LineSpacing = 200 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 rx = new prt.RenderText rx.x = 30 rx.y = 30 rx.Text = ("钢号") rx.Style.TextAngle = -90 \'顺时钟旋转90度 \' rx.Style.LineSpacing = 200 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 Next \'Doc.PrinterName = "Canon G1010 series" \'指定的打印机上打印 Doc.Preview() \'预览报表 |
||||
-- 作者:lhfu -- 发布时间:2019/7/28 22:32:00 -- 蓝老师,我想问一下,如果不用x、y来确认文字位置的情况下,换成居中、左边对齐、自动回车这样的语句,是否也起到一定的效果呢? Dim doc As New PrintDoc Dim rx As prt.RenderText Dim rm As prt.RenderImage doc.PageSetting.Width = 58 \'纸张宽度为85毫米 doc.PageSetting.Height = 85 \'纸张高度为58毫米 Doc.PageSetting.LeftMargin = 10 \'设置左边距 Doc.PageSetting.RightMargin = 10\'设置右边距 Doc.PageSetting.TopMargin = 0 \'设置上边距 Doc.PageSetting.BottomMargin = 0 \'设置下边 Dim Currow As Row Dim tbl As Table = Tables("合格证") For i As Integer = tbl.TopRow To tbl.BottomRow CurRow = tbl.rows(i) Dim rep As New prt.RenderEmpty \'定义一个新的空对象 rep.BreakBefore = prt.BreakEnum.Page \'打印前换页 doc.Body.Children.Add(rep ) \'加入到报表中 rx = new prt.RenderText rx.x = 10 rx.y = 30 rx.Text = CurRow("型号") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 10 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 rx = new prt.RenderText rx.x = 20 rx.y = 30 rx.Text = CurRow("钢号") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 10 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 rx = new prt.RenderText rx.x = 30 rx.y = 30 rx.Text = CurRow("检验") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 10 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 rx = new prt.RenderText rx.x = 40 rx.y = 30 rx.Text = CurRow("日期") rx.Style.TextAngle = 90 \'顺时钟旋转90度 rx.Style.LineSpacing = 10 \'设置双倍行距 rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) doc.Body.Children.Add(rx) \'加入到报表中 Next \'Doc.PrinterName = "Canon G1010 series" \'指定的打印机上打印 Doc.Preview() \'预览报表 |
||||
-- 作者:有点蓝 -- 发布时间:2019/7/28 23:16:00 -- 套打的最好使用绝对定位 |
||||
-- 作者:lhfu -- 发布时间:2019/7/28 23:31:00 -- 好的,谢谢 |