Foxtable(狐表)用户栏目专家坐堂 → [求助]专业报表套打


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

主题:[求助]专业报表套打

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


加好友 发短信
等级:小狐 帖子:393 积分:3181 威望:0 精华:0 注册:2019/4/13 16:10:00
[求助]专业报表套打  发帖心情 Post By:2020/7/20 17:45:00 [显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20200720173205.jpg
图片点击可在新窗口打开查看


图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20200720173840.jpg
图片点击可在新窗口打开查看


整体打印都会偏右,检查了一天不知道哪里错误,麻烦老师帮忙看看代码有没错误

譬如:我量了货物名称这里到左边距离大概是2.1CM  ,代码那里定位 X=21,但是实际打印却是偏右的

下面这个是代码:

Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim rm As prt.RenderImage '定义一个图形队形
Dim CurRow As Row = Tables("物流单").Current

doc.PageSetting.Width = 212 '纸张宽度为100毫米
doc.PageSetting.Height = 145 '纸张高度为120毫米

doc.PageSetting.Landscape =False '纵向打印
doc.AutoRotate = False '禁止自动旋转打印内容

Doc.PageSetting.LeftMargin = 20 '设置左边距
Doc.PageSetting.RightMargin = 20 '设置右边距
Doc.PageSetting.TopMargin = 2 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距


rx = new prt.RenderText
rx.Text = CurRow("发站")
rx.x = 97
rx.y = 20
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("到站")
rx.x = 130
rx.y = 20
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("托运人")
rx.x = 50
rx.y = 25
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("托运电话")
rx.x = 39
rx.y = 35
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("托运地址")
rx.x = 39
rx.y = 45  '45.3
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("收货人")
rx.x = 128
rx.y = 25
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("收货电话")
rx.x = 117
rx.y = 35
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("收货地址")
rx.x = 117
rx.y = 45  '45.3
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("货物名称1")
rx.x = 21   '5
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("件数1")
rx.x = 57   '+5
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("重量1")
rx.x = 70
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("体积1")
rx.x = 87
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("包装1")
rx.x = 105
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("运费1")
rx.x = 121
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("送货单1")
rx.x = 139  '112
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("回单1")
rx.x = 155
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("货物名称2")
rx.x = 21  '5
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("件数2")
rx.x = 52   '+5
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("重量2")
rx.x = 70
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("体积2")
rx.x = 87
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("包装2")
rx.x = 105
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("运费2")
rx.x = 121
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("送货单2")
rx.x = 139 '112
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("回单2")
rx.x = 155
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("特约事项1")
rx.x = 185 '156
rx.y = 60 '60
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("特约事项2")
rx.x = 185 '156
rx.y = 66
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("现付")
rx.x = 45
rx.y = 75
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("到付")
rx.x = 69
rx.y = 75
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("月结")
rx.x = 94
rx.y = 75
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("回付")
rx.x = 122
rx.y = 75
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("货到打卡")
rx.x = 150
rx.y = 75
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("代收货款")
rx.x = 138
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("备注")
rx.x = 160
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = CurRow("代收")
rx.x = 160
rx.y = 88 '+2
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label1").text
rx.x = 55 '+2
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label2").text
rx.x = 72
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label3").text
rx.x = 88
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label4").text
rx.x = 100
rx.y = 83 '84.8
doc.body.Children.Add(rx)

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label5").text
rx.x = 115
rx.y = 83 '84.8
doc.body.Children.Add(rx)

Doc.Print() '打印报表



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


加好友 发短信
等级:小狐 帖子:393 积分:3181 威望:0 精华:0 注册:2019/4/13 16:10:00
  发帖心情 Post By:2020/7/20 18:04:00 [显示全部帖子]

rx = new prt.RenderText
rx.Text = e.Form.Controls("Label5").text
rx.left = 115
rx.top = 83 '84.8
doc.body.Children.Add(rx)

这样来设置?

提示错误:

left 不是C1.C1preview.RenderText 的成员
错误代码: rx.left = 115
[此贴子已经被作者于2020/7/20 18:08:19编辑过]

 回到顶部