Foxtable(狐表)用户栏目专家坐堂 → yangming版主请进 标签大小怎么无法固定


  共有12481人关注过本帖树形打印复制链接

主题:yangming版主请进 标签大小怎么无法固定

帅哥哟,离线,有人找我吗?
floor2
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:369 积分:2911 威望:0 精华:0 注册:2009/4/1 12:51:00
yangming版主请进 标签大小怎么无法固定  发帖心情 Post By:2010/1/23 17:31:00 [只看该作者]

 根据版主的代码设计了标签内的条码,在A4纸大小可以打印
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目7.rar

,不过很大,在小纸张里打标签很小,
[此贴子已经被作者于2010-1-23 17:32:33编辑过]

 回到顶部
美女呀,离线,留言给我吧!
yangming
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:超级版主 帖子:4109 积分:23338 威望:0 精华:21 注册:2008/9/1 20:07:00
  发帖心情 Post By:2010/1/23 17:52:00 [只看该作者]

你是开发版吧,我是商业版,打不开你的文件

 回到顶部
帅哥哟,离线,有人找我吗?
floor2
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:369 积分:2911 威望:0 精华:0 注册:2009/4/1 12:51:00
  发帖心情 Post By:2010/1/23 17:58:00 [只看该作者]

这个是代码,大小无法更改


 Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim rx As New prt.RenderText '定义一个文本对象
Dim CurRow As dataRow = dr 'Tables("生产清单明细").Current
'加入标题
rx.text = "产品合格证"
rx.Style.FontBold = True '字体加粗
rx.Style.FontSize = 16 '大体大小为16磅
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中排列
rx.Style.Spacing.Bottom = 3 '和下面的对象(表格)距离3毫米
doc.Body.Children.Add(rx) '加入到报表中
'指定行数?列数?列宽?行高
rt.Rows.Count = 5 '设置总行数
rt.Cols.Count = 4 '设置总列数
rt.Height = 40 '设置表格的高度为80毫米
'rt.Rows(6).Height = 40 '设置第7行(显示备注的行)的高度为40毫米,剩余高度被平均分排到其他行
rt.Cols(0).Width = 24 '设置前四列的宽度,剩余的宽度被分配给5列(显示图片的那列)
rt.Cols(1).Width = 35
rt.Cols(2).Width = 24
rt.Cols(3).Width = 40
'设置合并单元格
'rt.Cells(0,4).SpanRows = 6 '第1行第5个单元格向下合并6行(用于显示照片)
rt.Cells(4,1).SpanCols = 3 '第5行第2个单元格向右合并3列(用于显示地址)
'rt.Cells(6,0).SpanCols = 5 '第7行第1个单元格向右合并5列(用于显示备注)
'设置表格样式
rt.CellStyle.Spacing.All = 1 '单元格内容缩进1毫米
rt.Style.GridLines.All = New prt.Linedef '设置网格线
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '内容垂直居中
rt.Rows(4).Style.TextAlignVert = prt.AlignVertEnum.Top '唯独第7行是备注,内容靠上对齐
'下面很简单,指定每一个单元格的内容
rt.Cells(0,0).Text= "颜色"
rt.Cells(0,1).Text = CurRow("颜色")
rt.Cells(0,2).Text= "幅宽"
rt.Cells(0,3).Text = CurRow("幅宽")
rt.Cells(1,0).Text= "颜色编号"
rt.Cells(1,1).Text = CurRow("颜色编号")
rt.Cells(1,2).Text= "克重"
rt.Cells(1,3).Text = CurRow("克重")
rt.Cells(2,0).Text= "卷长"
rt.Cells(2,1).Text = CurRow("卷长")
rt.Cells(2,2).Text= "重量"
rt.Cells(2,3).Text = CurRow("净重")
rt.Cells(3,0).Text= "日期"
rt.Cells(3,1).Text = format(CurRow("打印时间"),"MMDD")
rt.Cells(3,2).Text= "检验"
rt.Cells(3,3).Text = CurRow("值班师傅")
rt.Cells(4,0).Text= "条形码"

Dim rbc As New prt.RenderBarCode()
rbc.Width = 22
rbc.Height = 59
rbc.BarCodeType = barcodeenum.code39
rbc.BarDirection = bardirectionenum.normal
rbc.Text = " " & currow("条形码")
'if Ch1.Checked = True Then
rbc.ShowText = True   '是否显示编码
'Else
'rbc.ShowText = False
'End If

rt.cells(4,1).RenderObject = rbc
'  ra.Children.Add(rt) '加入到容器中
' Doc.Body.ChildRen.Add(ra) '将容器加入到报表中

'rt.Cells(3,3).Text= " tiao"
'rt.Cells(3,3).Text = CurRow("邮政编码")
'rt.Cells(4,0).Text= "地址"
'rt.Cells(4,1).Text = CurRow("地址")
'rt.Cells(5,0).Text= "家庭电话"
'rt.Cells(5,1).Text = CurRow("家庭电话")
'rt.Cells(5,2).Text= "办公电话"
'rt.Cells(5,3).Text = CurRow("办公电话")
'rt.Cells(6,0).Text = CurRow("备注")
'rt.Cells(0,4).Image = GetImage(CurRow("照片"))
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Doc.Preview() '预览报表

 回到顶部
美女呀,离线,留言给我吧!
yangming
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:超级版主 帖子:4109 积分:23338 威望:0 精华:21 注册:2008/9/1 20:07:00
  发帖心情 Post By:2010/1/23 18:25:00 [只看该作者]

你将表导出为EXCEL,我导入后加入代码再测试

 回到顶部
帅哥哟,离线,有人找我吗?
czy
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章 三级勋章 二级勋章
等级:超级版主 帖子:6318 积分:33945 威望:0 精华:10 注册:2008/8/31 20:56:00
  发帖心情 Post By:2010/1/23 19:03:00 [只看该作者]

……
rt.Rows.Count = 5
rt.Cols.Count = 4
rt.Height = 40
rt.Rows(4).Height = 13
rt.Cols(0).Width = 24
……

下次传文件别这么小气。

 回到顶部
帅哥哟,离线,有人找我吗?
floor2
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:369 积分:2911 威望:0 精华:0 注册:2009/4/1 12:51:00
  发帖心情 Post By:2010/1/23 19:47:00 [只看该作者]

 好的 谢谢,明天试试

 回到顶部
美女呀,离线,留言给我吧!
yangming
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:超级版主 帖子:4109 积分:23338 威望:0 精华:21 注册:2008/9/1 20:07:00
  发帖心情 Post By:2010/1/23 20:09:00 [只看该作者]

Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim rx As New prt.RenderText '定义一个文本对象
Dim CurRow As Row = Tables("表A").Current
'加入标题
rx.text = "产品合格证"
rx.Style.FontBold = True '字体加粗
rx.Style.FontSize = 16 '大体大小为16磅
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中排列
rx.Style.Spacing.Bottom = 3 '和下面的对象(表格)距离3毫米
doc.Body.Children.Add(rx) '加入到报表中
'指定行数?列数?列宽?行高
rt.Rows.Count = 5 '设置总行数
rt.Cols.Count = 4 '设置总列数
rt.Height = 40 '设置表格的高度为80毫米
rt.Width = "Parent.Width"
rt.Cols(0).Width = 15 '设置前四列的宽度,剩余的宽度被分配给5列(显示图片的那列)
rt.Cols(1).Width = 10
rt.Cols(2).Width = 15
rt.Cols(3).Width = 10
'设置合并单元格
rt.Cells(4,1).SpanCols = 3 '第5行第2个单元格向右合并3列(用于显示地址)
'设置表格样式
rt.CellStyle.Spacing.All = 1 '单元格内容缩进1毫米
rt.Style.GridLines.All = New prt.Linedef '设置网格线
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '内容垂直居中
rt.Rows(4).Style.TextAlignVert = prt.AlignVertEnum.Top '唯独第7行是备注,内容靠上对齐
doc.PageSetting.Width = 160 '纸张宽度为100毫米
doc.PageSetting.Height = 110 '纸张高度为120毫米
'下面很简单,指定每一个单元格的内容
rt.Cells(0,0).Text= "颜色"
rt.Cells(0,1).Text = CurRow("颜色")
rt.Cells(0,2).Text= "幅宽"
rt.Cells(0,3).Text = CurRow("幅宽")
rt.Cells(1,0).Text= "颜色编号"
rt.Cells(1,1).Text = CurRow("颜色编号")
rt.Cells(1,2).Text= "克重"
rt.Cells(1,3).Text = CurRow("克重")
rt.Cells(2,0).Text= "卷长"
rt.Cells(2,1).Text = CurRow("卷长")
rt.Cells(2,2).Text= "重量"
rt.Cells(2,3).Text = CurRow("净重")
rt.Cells(3,0).Text= "日期"
rt.Cells(3,1).Text = format(CurRow("打印时间"),"MMDD")
rt.Cells(3,2).Text= "检验"
rt.Cells(3,3).Text = CurRow("值班师傅")
rt.Cells(4,0).Text= "条形码"

Dim rbc As New prt.RenderBarCode()
rbc.Width = 70
rbc.Height = 20
rbc.BarCodeType = barcodeenum.code39
rbc.BarDirection = bardirectionenum.normal
rbc.Text = "   " & currow("条形码")
rbc.ShowText = True   '是否显示编码
rt.cells(4,1).RenderObject = rbc
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.TextAlignHorz = prt.AlignVertEnum.Center
doc.Body.Children.Add(rt) '将表格对象加入到报表中
Doc.Preview() '预览报表


 回到顶部
帅哥哟,离线,有人找我吗?
floor2
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:369 积分:2911 威望:0 精华:0 注册:2009/4/1 12:51:00
  发帖心情 Post By:2010/1/24 12:08:00 [只看该作者]

 增加了页边距设置,终于可以了,谢谢

 回到顶部