以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 电子章 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=119031) |
-- 作者:刘林 -- 发布时间:2018/5/16 15:02:00 -- 电子章 此主题相关图片如下:qq图片20180516144417.png Dim tb As Table=Tables("县区_table1") tb.sort="xxmc,bjdm" Dim doc As New PrintDoc \'定义一个报表 doc.PageSetting.Width = 82 \'纸张宽度为100毫米 doc.PageSetting.Height = 124 \'纸张高度为120毫米 doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight Doc.PageSetting.leftMargin = 0 Doc.PageSetting.rightMargin = 0 Doc.PageSetting.TopMargin =0 Doc.PageSetting.BottomMargin =0 \'For Each r As Row In tb.Rows For i As Integer = tb.TopPosition To tb.BottomPosition Dim ra As New prt.RenderArea Dim rt As prt.RenderText ra.Width = 82 \'宽度53毫米 ra.Height = 125 \'高度24毫米 \'ra.Style.Spacing.all = 5 ra.Style.Spacing.Top =6 ra.Style.Spacing.Bottom =4 ra.Style.Spacing.left =5.5 ra.Style.Spacing.right =5.5 ra.Style.Borders.All = New prt.Linedef(0.1, Color.black) \'设置边框 ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never \'禁止水平分割 ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'禁止垂直分割 Doc.Body.ChildRen.Add(ra) \'将容器加入到报表中 rt = New prt.RenderText rt.Text = "内江市2018年初中学业水平考试" & vbcrlf & " 暨高中阶段招生考试" rt.Style.Font=New Font("黑体", 8, FontStyle.Bold) rt.Y =2 rt.x=2 ra.Children.Add(rt) \'添加到容器中 rt = New prt.RenderText rt.Text = " 准 考 证" rt.Style.Font=New Font("黑体", 16, FontStyle.Bold) rt.Y =9 rt.x=2 ra.Children.Add(rt) \'添加到容器中 rt = New prt.RenderText rt.Text = "姓 名:" & tb.rows(i)("xm") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 20 rt.x=1 ra.Children.Add(rt) \'添加到容 Dim Line As New prt.LineDef(0.2, Color.black) Dim ln As New prt.RenderLine(18,24, 45, 24, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "中考考号:" & tb.rows(i)("ksh") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 26 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,30, 45, 30, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "中考考点:" & tb.rows(i)("kdxxdm") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 32 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,36, 45, 36, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "生地考号:" & tb.Rows(i)("生地考号") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 39 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,43, 45, 43, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "生地考点:" & tb.Rows(i)("生地考点") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 45 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,49, 45, 49, Line) ra.Children.Add(ln) \'将线条加入到报表中 Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.QRCode Bar.QRCodeErrorCorrectionLevel = Barpro.QRCodeErrorCorrectionLevel.m BAR.DisplayCode = False Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight bar.Code = "http://118.118.191.35:800" Bar.Text = "扫码填志愿 " Bar.TextAlignment = Barpro.Alignment.BelowCenter rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 0 rg.x=47 rg.y=40 RG.Width=25 ra.Children.Add(rg) Bar = New BarCodeBuilder Bar.Symbology = Barpro.Symbology.Code128 BAR.DisplayCode = False Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight bar.Code = tb.Rows(i)("bmh") Bar.Text = tb.Rows(i)("bmh") Bar.BarRatio = 3 Bar.BarHeight = 10 Bar.TextAlignment = Barpro.Alignment.BelowCenter rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 0 rg.x=6 rg.y=50 RG.Width=50 ra.Children.Add(rg) rt = New prt.RenderText rt.Text = tb.Rows(i)("bjdm") rt.Style.Font=New Font("宋体", 6, FontStyle.Bold) rt.Y = 15 rt.x=22 ra.Children.Add(rt) \'添加到容 Dim rm As New prt.RenderImage() rm.Style.ImageAlign.KeepAspectRatio= False rm.Image= GetImage(projectPath & "remotefiles" & tb.Rows(i)("相片")) rm.Width=25 rm.Height=37 rm.Y = 2 rm.x=47 ra.Children.Add(rm) \'添加到容 rm = New prt.RenderImage() rm.Style.ImageAlign.KeepAspectRatio= False rm.Image= GetImage(projectPath & "attachments\\" & "ap.png") rm.Width=71 rm.Height=50 rm.Y = 65 rm.x=0 ra.Children.Add(rm) \'添加到 Next Doc.Preview() \'预览报表 老师,现在的想法是在相片上盖一个电子公章如何可以实现?
|
-- 作者:有点甜 -- 发布时间:2018/5/16 15:07:00 -- 插入一个图片,然后地位图片的位置,即可
http://www.foxtable.com/webhelp/scr/1182.htm
http://www.foxtable.com/webhelp/scr/1177.htm
|
-- 作者:刘林 -- 发布时间:2018/5/16 17:11:00 -- 问题是这样章的图片会把下面全盖了,我要仅印上章的红色部分,其余部分要将下面的内容显示出来 |
-- 作者:cd_tdh -- 发布时间:2018/5/16 17:24:00 -- 你章的位置准备放哪儿,如果在照片上,用png格式图片删除图片背景色试试,如果在文字部分位置,设置图片在文字下方。 [此贴子已经被作者于2018/5/16 17:25:47编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/5/16 18:16:00 -- 以下是引用刘林在2018/5/16 17:11:00的发言:
问题是这样章的图片会把下面全盖了,我要仅印上章的红色部分,其余部分要将下面的内容显示出来
图片用gif或者png,背景要弄成透明的。不会做发实例上来测试。
|
-- 作者:刘林 -- 发布时间:2018/5/16 23:01:00 -- 还是这个问题,我测试了下面是个图片,上面用pnt图片章,设为秀明,但不能把下面的内容显示出来 |
-- 作者:有点甜 -- 发布时间:2018/5/16 23:34:00 -- 以下是引用刘林在2018/5/16 23:01:00的发言:
还是这个问题,我测试了下面是个图片,上面用pnt图片章,设为秀明,但不能把下面的内容显示出来
我测试没问题,你的图片必须是背景透明的才行(图片本身背景透明)
Dim doc As New PrintDoc \'定义一个报表对象 |
-- 作者:有点甜 -- 发布时间:2018/5/16 23:35:00 -- 不会做,请上传具体实例 |
-- 作者:刘林 -- 发布时间:2018/5/17 17:09:00 -- Dim tb As Table=Tables("县区_table2") tb.sort="学校名称,班级" Dim doc As New PrintDoc \'定义一个报表 doc.PageSetting.Width = 82 \'纸张宽度为100毫米 doc.PageSetting.Height = 124 \'纸张高度为120毫米 doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight Doc.PageSetting.leftMargin = 0 Doc.PageSetting.rightMargin = 0 Doc.PageSetting.TopMargin =0 Doc.PageSetting.BottomMargin =0 \'For Each r As Row In tb.Rows For i As Integer = tb.TopPosition To tb.BottomPosition Dim ra As New prt.RenderArea Dim rt As prt.RenderText ra.Width = 82 \'宽度53毫米 ra.Height = 125 \'高度24毫米 ra.Style.Spacing.Top =6 ra.Style.Spacing.Bottom =4 ra.Style.Spacing.left =5.5 ra.Style.Spacing.right =5.5 ra.Style.Borders.All = New prt.Linedef(0.1, Color.black) \'设置边框 ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never \'禁止水平分割 ra.SplitVertBehavior = prt.SplitBehaviorEnum.Never \'禁止垂直分割 Doc.Body.ChildRen.Add(ra) \'将容器加入到报表中 rt = New prt.RenderText rt.Text = "内江市2018年初中学业水平考试" & vbcrlf & " 暨高中阶段招生考试" rt.Style.Font=New Font("黑体", 8, FontStyle.Bold) rt.Y =2 rt.x=2 ra.Children.Add(rt) \'添加到容器中 rt = New prt.RenderText rt.Text = " 准 考 证" rt.Style.Font=New Font("黑体", 16, FontStyle.Bold) rt.Y =9 rt.x=2 ra.Children.Add(rt) \'添加到容器中 rt = New prt.RenderText rt.Text = "姓 名:" & tb.rows(i)("姓名") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 20 rt.x=1 ra.Children.Add(rt) \'添加到容 Dim Line As New prt.LineDef(0.2, Color.black) Dim ln As New prt.RenderLine(18,24, 45, 24, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "中考考号:" \' & tb.rows(i)("") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 26 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,30, 45, 30, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "中考考点:" \' & tb.rows(i)("kdxxdm") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 32 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,36, 45, 36, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "生地考号:" & tb.Rows(i)("考试号") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 39 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,43, 45, 43, Line) ra.Children.Add(ln) \'将线条加入到报表中 rt = New prt.RenderText rt.Text = "生地考点:" & tb.Rows(i)("考点学校") rt.Style.Font=New Font("宋体", 11, FontStyle.Bold) rt.Y = 45 rt.x=1 ra.Children.Add(rt) \'添加到容 Line = New prt.LineDef(0.2, Color.black) ln = New prt.RenderLine(18,49, 45, 49, Line) ra.Children.Add(ln) \'将线条加入到报表中 Dim rg As prt.RenderGraphics Dim Bar As New BarCodeBuilder Bar.Symbology = Barpro.Symbology.QRCode Bar.QRCodeErrorCorrectionLevel = Barpro.QRCodeErrorCorrectionLevel.m BAR.DisplayCode = False Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight bar.Code = "http://118.118.191.35:800" Bar.Text = "扫码填志愿 " Bar.TextAlignment = Barpro.Alignment.BelowCenter rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 0 rg.x=47 rg.y=40 RG.Width=25 ra.Children.Add(rg) Bar = New BarCodeBuilder Bar.Symbology = Barpro.Symbology.Code128 BAR.DisplayCode = False Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight bar.Code = tb.Rows(i)("报名号") Bar.Text = tb.Rows(i)("报名号") Bar.BarRatio = 3 Bar.BarHeight = 10 Bar.TextAlignment = Barpro.Alignment.BelowCenter rg = new prt.RenderGraphics bar.DrawOnCanvas(rg.Graphics,0,0,1) rg.Style.Spacing.All = 0 rg.x=6 rg.y=50 RG.Width=50 ra.Children.Add(rg) rt = New prt.RenderText rt.Text = tb.Rows(i)("班级") rt.Style.Font=New Font("宋体", 6, FontStyle.Bold) rt.Y = 15 rt.x=22 ra.Children.Add(rt) \'添加到容 Dim rm As New prt.RenderImage() rm.Style.ImageAlign.KeepAspectRatio= False rm.Image= GetImage(projectPath & "remotefiles" & tb.Rows(i)("相片")) rm.Width=25 rm.Height=37 rm.Y = 2 rm.x=47 ra.Children.Add(rm) \'添加到容 rm = New prt.RenderImage() rm.Style.ImageAlign.KeepAspectRatio= False rm.Image= GetImage(projectPath & "attachments\\" & "ap.png") rm.Width=71 rm.Height=50 rm.Y = 65 rm.x=0 ra.Children.Add(rm) \'添加到 rm= New prt.RenderImage \'定义一个图片对象 rm.Image = GetImage(projectPath & "attachments\\" & "gz.png") \'设置图片 rm.x = 39 rm.y = 30 rm.width=40 rm.Height=40 \'rm.Style.ImageAlign.StretchHorz = False \'禁止图片水平拉伸 rm.Style.ImageAlign.AlignHorz = prt.ImageAlignHorzEnum.Center \'居中显示 ra.Children.Add(rm) Next Doc.Preview() \'预览报表 老师,为什么当多选几条记录打印时,章就不显示,而一条就要显
|
-- 作者:有点甜 -- 发布时间:2018/5/17 17:31:00 -- 看了下代码,代码不应该有问题的,每一个印章图片都是添加在ra里面的,有多少行,就会有多少个ra,就会添加多少张图片的。
请做个例子发上来测试。
|