Dim rx As prt.RenderText
Dim rt As prt.RenderTable
Dim Rows As List(Of DataRow)
Dim tbl As new List(of DataRow)
tbl = DataTables("日记账").SQLSelect("[公司编码] = '" & _UserGsbm & "'and [日期] = '" & pzrq.Value & "'")
For i As Integer = 0 To tbl.Count - 1
rx = New prt.RenderText
rx.Style.FontSize = 12
rx.Style.FontBold = True
rx.Style.Spacing.Bottom = 5
rx.Text = "流水编号: " & tbl(i)("流水编号") & "日期:" & tbl(i)("日期") & "收入:" & tbl(i)("收入") & "支出:" & tbl(i)("支出") & "流水状态:" & tbl(i)("流水状态") & "记账人:" & tbl(i)("记账_负责") & "记账日期:" & tbl(i)("记账_日期")
doc.Body.Children.Add(rx)
rt = New prt.RenderTable
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.Style.Borders.Bottom = New prt.LineDef(0.3,Color.LightGray)
rt.CellStyle.Spacing.All = 1
rt.Cols.Count = 4
rt.Cells(0,0).Text = "明细编号"
rt.Cells(0,1).Text = "摘要日期"
rt.Cells(0,2).Text = "摘要对象"
rt.Cells(0,3).Text = "摘要事件"
rt.Cells(0,4).Text = "收支方式"
rt.Cells(0,5).Text = "凭证编号"
rt.Cells(0,6).Text = "收入"
rt.Cells(0,7).Text = "支出"
rt.Cells(0,8).Text = "订单编号"
rt.rows(0).Style.Borders.Top = New prt.LineDef(1,Color.LightGray)
rt.rows(0).Style.Borders.Bottom = New prt.LineDef(1,Color.LightGray)
Rows = tbl(i).GetChildRows("明细账")
For r As Integer = 0 To Rows.Count - 1
rt.Cells(r+1,0).Text = rows(r)("明细编号")
rt.Cells(r+1,1).Text = rows(r)("摘要日期")
rt.Cells(r+1,2).Text = rows(r)("摘要对象")
rt.Cells(r+1,3).Text = rows(r)("摘要事件")
rt.Cells(r+1,4).Text = rows(r)("收支方式")
rt.Cells(r+1,5).Text = rows(r)("凭证编号")
rt.Cells(r+1,6).Text = rows(r)("收入")
rt.Cells(r+1,7).Text = rows(r)("支出")
rt.Cells(r+1,8).Text = rows(r)("订单编号")
Next
doc.Body.Children.Add(rt)
rx = New prt.RenderText
rx.Style.FontBold = True
rx.Style.Spacing.Top = 3
rx.Text = "笔数: " & Rows.Count
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Right
doc.Body.Children.Add(rx)
Next
想问下,这个求 关联表子表的怎么写?