以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  零值  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=139880)

--  作者:nbsugu_z
--  发布时间:2019/8/24 8:46:00
--  零值
Dim r As Row = Tables("gcht").current

Dim tm As String  = ProjectPath & "Attachments\\" & "购销合同样本.doc"\'指定模板文件
Dim fl As String = ProjectPath & "Reports\\" & "购销合同样本.doc" \'指定目标文件
Dim wrt As New WordReport(Tables("gcht"),tm,fl) \'定义一个WordReport
wrt.Build() \'逐行生成报表
wrt.Show() \'显示报表

老师,生成的word表中 如何不显示“0” 零值的字段显示为空白


--  作者:有点蓝
--  发布时间:2019/8/24 8:50:00
--  
在生成报表之前把表格的0值设置为空,如

for each r as row in tables("表A").rows
if r("第一列") = 0 then
r("第一列") = nothing
end if
next

--  作者:nbsugu_z
--  发布时间:2019/8/24 9:00:00
--  
For Each r As Row In Tables("gcht").rows
    If r("数量3") = 0 Then
        r("数量3") = Nothing
    End If
Next
Dim r As Row = Tables("gcht").current
Dim tm As String  = ProjectPath & "Attachments\\" & "购销合同样本.doc"\'指定模板文件
Dim fl As String = ProjectPath & "Reports\\" & "购销合同样本.doc" \'指定目标文件
Dim wrt As New WordReport(Tables("gcht"),tm,fl) \'定义一个WordReport
wrt.Build() \'逐行生成报表
wrt.Show() \'显示报表
代码错误(第一行代码好象不对)
[此贴子已经被作者于2019/8/24 9:01:33编辑过]

--  作者:有点蓝
--  发布时间:2019/8/24 9:13:00
--  
提示什么错误?