Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
这个我看过。这是第一页指定位置,后面几页就不行了。
因为表格是多页,希望标题在每页的固定的位置打印出来,每页的标题下面再打印表格。 |
下载信息 [文件大小: 下载次数: ] | |
![]() |
看这个:
Dim doc As New PrintDoc
Dim tb As Table = Tables("表A")
For p As Integer = 0 To math.Ceiling(tb.Rows.Count / 5) - 1 '每页5行
Dim rx As New prt.RenderText
rx.Text = "Hello Foxtable"
doc.Body.Children.Add(rx)
Dim rt As New prt.RenderTable
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray)
rt.CellStyle.Spacing.All = 0.5
rt.Cells(0,0).Text = "第一列"
rt.Cells(0,1).text = "第二列"
For r As Integer = p * 5 To math.min(tb.Rows.Count - 1,(p+1) * 5 - 1)
rt.Cells(r - p * 5 + 1,0).Text = tb.rows(r)("第一列")
rt.Cells(r - p * 5 + 1,1).text = tb.rows(r)("第二列")
Next
If p < math.Ceiling(tb.Rows.Count / 5) - 1
rt.BreakAfter = prt.BreakEnum.Page
End If
doc.Body.Children.Add(rt)
Next
doc.Preview()