以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于报表管理的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=131476)

--  作者:kljbdjz
--  发布时间:2019/2/27 10:29:00
--  关于报表管理的问题
如果其中某一项为空,则不导出该项,比如楼盘没有内容时,就不导出楼盘这一项。可以实现吗?代码该怎么写?

代码如下:
Dim doc As New PrintDoc
Dim rt As New prt.RenderText
Dim r As Row = Tables("询盘表").Current
rt.Text= "编号:" & r("编号")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "派单人:" & r("派单人")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "姓名:" & r("姓名")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "联系电话:" & r("联系电话")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "楼盘:" & r("楼盘")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "面积:" & r("面积")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "日期:" & r("询盘日期")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "时间:" & r("询盘时间")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "询盘来源:" & r("询盘来源")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "类型:" & r("类型")
doc.body.Children.Add(rt)

rt = New prt.RenderText
rt.Text= "询盘网址:" & r("询盘网址")
doc.body.Children.Add(rt)

doc.Preview()

--  作者:有点甜
--  发布时间:2019/2/27 10:32:00
--  
If r("楼盘") <> nothing then
    rt = New prt.RenderText
    rt.Text= "楼盘:" & r("楼盘")
    doc.body.Children.Add(rt)
End If