Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
'''
Dim doc As New Printdoc
Dim rpar As New prt.RenderParagraph() '定义一个段落对象
rpar.Content.AddText("m")
rpar.Content.AddText("3", prt.TextPositionEnum.Superscript)
rpar.Content.AddText("m")
rpar.Content.AddText("2",prt.TextPositionEnum.Superscript)
doc.body.Children.add(rpar)
'报表内容设置
Dim rt As prt.RenderTable
rt = New prt.RenderTable
rt.RowGroups(0,2).Header = prt.TableHeaderEnum.All '将前2行在每页显视
'设置列标题
rt.Cells(0,0).Text = "第1列"
rt.Cells(0,1).Text = "第2列"
rt.Cells(0,2).Text = "第3列"
rt.Cells(0,3).Text = "第4列"
rt.Cells(1,0).Text = rpar.text '第2行第一列,在这里引用段落的内容
rt.Cells(1,1).Text ="" '第2行第2列
With Tables("表A.表B")
For r As integer = 0 To .Rows.Count - 1 '遍历关联表每一行
'rt.Cells(r+2,0).Text = .rows(r)("第一列")
rt.Cells(r+2,1).Text = .rows(r)("第二列")
rt.Cells(r+2,2).Text = .rows(r)("第三列")
rt.Cells(r+2,3).Text = .rows(r)("第四列")
Next
End With
doc.Body.Children.Add(rt)
doc.Preview
'''
Dim doc As New Printdoc '定义1个报表
Dim rpar As New prt.RenderParagraph() '定义一个段落对象,建上标
rpar.Content.AddText("m")
rpar.Content.AddText("3", prt.TextPositionEnum.Superscript)
Dim rt As prt.RenderTable '定义1个表格
rt = New prt.RenderTable
rt.RowGroups(0,2).Header = prt.TableHeaderEnum.All '将表格的前2行在每页显视
'设置列标题
rt.Cells(0,0).Text = "第1列"
rt.Cells(0,1).Text = "第2列"
rt.Cells(0,2).Text = "第3列"
rt.Cells(0,3).Text = "第4列"
'定义1个单元格容器
Dim rak As prt.RenderArea
rak = rt.Cells(1,1).Area '引用第2行第2列的单元格
rak.Children.Add(rpar) '将上标加入第2行第2列
'读取表B数据
With Tables("表A.表B")
For r As integer = 0 To .Rows.Count - 1 '遍历关联表每一行
rt.Cells(r+2,0).Text = .rows(r)("第一列")
rt.Cells(r+2,1).Text = .rows(r)("第二列")
rt.Cells(r+2,2).Text = .rows(r)("第三列")
rt.Cells(r+2,3).Text = .rows(r)("第四列")
Next
End With
doc.Body.Children.Add(rt) '将rt表格加到到报表中
doc.Preview