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() \'打印报表