以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 打印一张如图所示的签名表,怎么设计? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=177443) |
-- 作者:deliangzhaoe -- 发布时间:2022/5/22 21:25:00 -- 打印一张如图所示的签名表,怎么设计? 想设计打印如图所示的签名表: 此主题相关图片如下:微信截图_20220522211710.png 代码如何写? 要求:序号顺序填充1-69,姓名有几人填充几人,小于23人时,在第二列,小于46人时,填充完第二列再填充第五列,依次类推,大于69人时,到下一页,签字列空白。 自己写了点代码,不对,哪位老师帮忙改一下,谢谢!
|
-- 作者:有点蓝 -- 发布时间:2022/5/22 21:53:00 -- 参考:http://www.foxtable.com/webhelp/topics/2241.htm,其它细节的东西自己处理 Dim doc As New PrintDoc Dim tb As Table = Tables("表A") Dim prs As Integer = 69 Dim caps() As String = {"序号", "姓名", "签字", "序号", "姓名", "签字", "序号", "姓名", "签字"} For p As Integer = 0 To math.Ceiling(tb.Rows.Count / prs) - 1 Dim rx As New prt.RenderText rx.Text = "公司活动签名表" rx.Style.Font = New Font("宋体", 16, FontStyle.Bold) rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center rx.Style.Spacing.Bottom = 3 Doc.body.Children.Add(rx) Dim rt As New prt.RenderTable rt.Cols.Count = 9 rt.Cols(0).Width = 10 \'设置各列宽度 rt.Cols(1).Width = 15 rt.Cols(2).Width = 20 rt.Cols(3).Width = 10 rt.Cols(4).Width = 15 rt.Cols(5).Width = 20 rt.Cols(6).Width = 10 rt.Cols(7).Width = 15 rt.Cols(8).Width = 20 rt.Style.Gridlines.All = New prt.Linedef(Color.Gray) rt.CellStyle.Spacing.All = 0.5 rt.Cells(0, 0).SpanCols = 2 rt.Cells(0, 0).Text = "企业名称" rt.Cells(0, 2).SpanCols = 3 rt.Cells(0, 2).Text = "xxx" \'rw("企业名称") rt.Cells(0, 5).SpanCols = 2 rt.Cells(0, 5).Text = "活动日期" rt.Cells(0, 7).SpanCols = 2 rt.Cells(0, 7).Text = "2022-05-22" \'rw("培训时间") rt.Cells(1, 0).SpanCols = 2 rt.Cells(1, 0).Text = "培训主题" rt.Cells(1, 2).SpanCols = 7 rt.Cells(1, 2).Text = "xxx" \'rw("培训主题") Dim idx As Integer = 2 For c As Integer = 0 To caps.Length - 1 rt.Cells(idx, c).Text = caps(c) Next idx = 3 Dim cl As Integer = 0 Dim i As Integer = 1 For r As Integer = p * prs To math.min(tb.Rows.Count - 1, ( p + 1) * prs - 1) If idx >= 26 Then idx = 3 cl = cl + 3 End If rt.Cells(idx, cl).Text = i rt.Cells(idx, cl + 1).Text = tb.rows(r)("姓名") idx += 1 i += 1 Next If p < math.Ceiling(tb.Rows.Count / prs) - 1 Then rt.BreakAfter = prt.BreakEnum.Page End If doc.Body.Children.Add(rt) Next doc.Preview()
|
-- 作者:deliangzhaoe -- 发布时间:2022/5/23 18:55:00 -- 谢谢蓝老师! |