Tables(e.Form.Name & "_Table1").SetColVisibleWidth("下单日期|40|销售单号|80|业务员|45|品名规格|110|P数|35|数量|55|总线数|55|出货日期|40|备注|160|客户|50|组别|40") Tables(e.Form.Name & "_Table1").AutoSizeRows() e.Form.Page.Width = 240 '纸张宽度为100毫米 e.Form.Page.Height = 140 '纸张高度为120毫米 e.Form.Page.LeftMargin = 5 '设置左边距 e.Form.Page.RightMargin = 1 '设置右边距 e.Form.Page.TopMargin = 3 '设置上边距 e.Form.Page.BottomMargin = 1 '设置下边距 Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox1") Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp) 'Doc.PrinterName = GetConfigValue("_zlddyj",DefaultPrinter) For Each c As object In Doc.Body.Children If Typeof c Is prt.RenderTable Then Dim t As prt.RenderTable = c For i As Integer = 0 To t.Rows.count-1 t.Rows(i).Height = "Auto" Next End If Next doc.AutoRotate = False '禁止自动旋转打印内容 doc.Preview(True)
|