老师:
您好!
下面的代码,如果是那一行空的,就显示是"部位"
加什么代码可以显示空的.
我用IFF,想不出办法,
rt.Cells(0,1).Text = IIF(CurRow(0).IsNull("部位"),"",CurRow(0)("部位"))
请老师指教!!!
谢谢谢
Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
Doc.PageSetting.LeftMargin
= 15 '设置左边距
Doc.PageSetting.RightMargin
= 10 '设置右边距
Doc.PageSetting.TopMargin
= 16 '设置上边距
Doc.PageSetting.BottomMargin
= 10 '设置下边距
rt.Width = "Parent.Width"
'对象宽度等于页面宽度
rt.Height = "Parent.Height"
'对象高度等于页面高度
Dim rx As New prt.RenderText '定义一个文本对象
Dim CurRow As Table = Tables("表A")
rt.Cells(0,0).Text = " 部 位"
rt.Cells(0,1).Text = CurRow(0)("部位")
rt.Cells(0,2).Text = CurRow(1)("部位")
rt.Cells(0,3).Text = CurRow(2)("部位")
rt.Cells(0,4).Text = CurRow(3)("部位")
rt.Cells(0,5).Text = CurRow(4)("部位")
doc.Body.Children.Add(rt)
'将表格对象加入到报表中
Doc.Preview() '预览报表
[此贴子已经被作者于2019/5/15 22:48:02编辑过]