下面代码是教程中的例子,假定当前的订单表上有多个产品记录,我希望只将产品名为 PD1的记录进行绑定,请问如何设置,谢谢!
Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim tb as
Table = Tables("订单")
Dim ColNames As
String() = New String(){"产品",
"客户","单价", "数量", "金额"}
For
c
As
integer = 0
To
ColNames.Length
-1
rt.Cells(0,c).Text = ColNames(c)
rt.Cols(c).Width =
tb.Cols(ColNames(c)).PrintWidth
rt.Cells(1, c).Text = "[Fields!" & ColNames(c) & ".Value]" '设置绑定表达式
Next
rt.RowGroups(0,1).Style.TextAlignVert = prt.AlignVertEnum.Center '第一行内容垂直居中
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All '将第一行作为表头。
rt.RowGroups(1,1).DataBinding.DataSource = BindTables("订单") '将第二行绑定到订单表
doc.Body.Children.Add(rt)
doc.Preview()