e.Form.ResumeRedraw
e.Form.StopRedraw
Dim doc As New PrintDoc '定义一个报表
doc.PageSetting.Width = 230 '纸张宽度为100毫米
doc.PageSetting.Height = 127 '纸张高度为120毫米
Dim rx As prt.RenderText '定义一个文本对象
Doc.PageSetting.LeftMargin = 19 '设置左边距
Doc.PageSetting.RightMargin = 20 '设置右边距
Doc.PageSetting.TopMargin = 24 '设置上边距
Doc.PageSetting.BottomMargin = 12 '设置下边距
Dim x As Integer = val(e.Form.Controls("TextBox01").Value) '定义水平偏移参数
Dim y As Integer = val(e.Form.Controls("TextBox02").Value) '定义垂直偏移参数
Dim rm As prt.RenderImage '定义一个图形队形
rm.Image = getImage("EMS套打.jpg")
rm.Width = 230 '宽度等于页面宽度
rm.Height = 127 '高度等于页面高度
Doc.WaterMark = rm '作为水印使用
With Tables("EMS编辑_table1")
For Each Currow As Row In .GetCheckedRows
Dim rep As New prt.RenderEmpty '定义一个新的空对象
rep.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rep ) '加入到报表中
rx = new prt.RenderText
rx.Text = CurRow("年")
rx.Style.Font = New Font("宋体", 10, FontStyle.Bold)
rx.x = 70 + x '设置坐标的时候,注意加上偏移参数
rx.y = 27 + y
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("月")
rx.Style.Font = New Font("宋体", 10, FontStyle.Bold)
rx.x = 82 + x '设置坐标的时候,注意加上偏移参数
rx.y = 27 + y
doc.body.Children.Add(rx)
......
rx = new prt.RenderText
rx.Text = CurRow("收件人邮政编码_6")
rx.Style.Font = New Font("宋体", 10, FontStyle.Bold)
rx.x = 204 + x '设置坐标的时候,注意加上偏移参数
rx.y = 68 + y
doc.body.Children.Add(rx)
Next
End With
_MyDoc = Doc
_MyRDL.Document = _MyDoc
Dim p As WinForm.Panel = e.Form.controls("Panel1")
If p.basecontrol.controls.count = 0 Then
_MyRDL.Dock = 5
p.BaseControl.Controls.Add(_MyRDL)
_MyRDL.Toolbars.File.Visible = False
End If
_MyDoc.Generate() '这句替代 doc.Preview() '预览
e.Form.ResumeRedraw