如果其中某一项为空,则不导出该项,比如楼盘没有内容时,就不导出楼盘这一项。可以实现吗?代码该怎么写?
代码如下:
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()