Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
rt.Height = 50
rt.Style.GridLines.All = New prt.Linedef \'设置网格线
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中
Dim tb As Table = Tables(e.Form.Name & "_Table1" )
For c As Integer = 0 To tb.Cols.Count -1
rt.Cells(0,c).Text = tb.Cols(c).Name
rt.Cols(c).Width = tb.Cols(tb.Cols(c).Name).PrintWidth
rt.Cells(1, c).Text = "[Fields!" & tb.Cols(c).Name & ".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(e.Form.Name & "_Table1") \'将第二行绑定到订单表
doc.Body.Children.Add(rt)
doc.Preview()
运行结果是:
此主题相关图片如下:vey4c3ka6(ytcjwz0jf3vn.gif
![dvubb 图片点击可在新窗口打开查看](UploadFile/2016-2/201621315202326350.gif)
难道这个不能绑定MSSQL,而只能绑定内部的表么?