以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]专业报表连续打印 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=152103) |
-- 作者:冷泉 -- 发布时间:2020/7/9 0:03: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 rt.Rows.Count = 3 \'设置总行数 rt.Cols.Count = 2 \'设置总列数 rt.Height = 80 \'设置表格的高度为80毫米 rt.Rows(0).Height = 40 \'设置第1行(显示备注的行)的高度为40毫米,剩余高度被平均分排到其他行 rt.Rows(1).Height = 20 \'设置第2行(显示备注的行)的高度为20毫米,剩余高度被平均分排到其他行 rt.Cols(0).Width = 70 \'设置前四列的宽度,剩余的宽度被分配给5列(显示图片的那列) rt.Cols(1).Width = 30 \'设置合并单元格 rt.Cells(1,0).SpanCols = 2 \'第5行第2个单元格向右合并3列(用于显示地址) rt.Cells(2,0).SpanCols = 2 \'第7行第1个单元格向右合并5列(用于显示备注) \'设置表格样式 rt.CellStyle.Spacing.All = 1 \'单元格内容缩进1毫米 rt.Style.GridLines.All = New prt.Linedef \'设置网格线 rx = new prt.RenderText rx.Text = "目的城市:" rx.x = 30 rx.y = 45 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("目的城市") rx.Style.Font = New Font("宋体", 60, FontStyle.Bold) \'设置字体 rx.x = 51 rx.y = 31: doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "线路车:" rx.x = 143 rx.y = 45 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("线路车") rx.Style.Font = New Font("宋体", 60, FontStyle.Bold) \'设置字体 rx.x = 160 rx.y = 31: doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "客户单号:" rx.x = 138 rx.y = 60 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("客户单号") rx.x = 153 rx.y = 60 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "收件人:" rx.x = 30 rx.y = 60 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("收件人") rx.x = 51 rx.y = 60 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("收件人电话") rx.x = 100 rx.y = 60 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "数量:" rx.x = 30 rx.y = 80 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("数量") rx.Style.Font = New Font("宋体", 30, FontStyle.Bold) \'设置字体 rx.x = 40 rx.y = 75 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "代收货款:" rx.x = 60 rx.y = 80 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("代收货款金额")&"元" rx.Style.Font = New Font("宋体", 30, FontStyle.Bold) \'设置字体 rx.x = 80 rx.y = 75 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "运费:" rx.x = 110 rx.y = 80 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("运费")&"元" rx.Style.Font = New Font("宋体", 30, FontStyle.Bold) \'设置字体 rx.x = 120 rx.y = 75 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("到付已付") rx.Style.Font = New Font("宋体", 30, FontStyle.Bold) \'设置字体 rx.x = 145 rx.y = 75 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "发件地址:" rx.x = 30 rx.y = 90 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("地址") rx.x = 50 rx.y = 90 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "发件人:" rx.x = 30 rx.y = 95 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("发件人") rx.x = 50 rx.y = 95 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "联系方式:" rx.x = 70 rx.y = 95 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("发件人电话") rx.x = 88 rx.y = 95 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "日期:" rx.x = 30 rx.y = 107 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = CurRow("日期") rx.x = 43 rx.y = 107 doc.body.Children.Add(rx) rx = new prt.RenderText rx.Text = "客服电话:9558888" rx.x = 155 rx.y = 107 doc.Body.Children.Add(rx) \'加入到报表中 doc.Body.Children.Add(rt) \'加入到报表中 Doc.Preview() \'预览报表
|
-- 作者:有点蓝 -- 发布时间:2020/7/9 9:15:00 -- 遍历所有行:http://www.foxtable.com/webhelp/topics/1438.htm |