以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 空值时去丢“ . ” (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=169672) |
-- 作者:zhuxinhui -- 发布时间:2021/6/25 15:30:00 -- 空值时去丢“ . ” 在表属性的事件Datacolshanged中使用下面的代码: e.DataRow("凭证内容") = e.DataRow("科目编码") &"."& e.DataRow("科目名称") &"."& e.DataRow("往来单位名称") &"."& e.DataRow("员工姓名") &"."& e.DataRow("货品名称") &"."& e.DataRow("数量")&"."& e.DataRow("部门名称")&"."& e.DataRow("项目名称")
使用上述代码生成了下面的结果:
怎样才能把没有值的“.”去丢,变成“1122.应收账款.深圳市***科技有限公司” |
-- 作者:有点蓝 -- 发布时间:2021/6/25 16:25:00 -- dim str() as string = {"科目编码","科目名称",........} dim s as string for each s2 as string in str if e.DataRow.isnull(s2) then continue for s = s & "." & e.DataRow(s2) next s = s.trim(".") e.DataRow("凭证内容") = s
|
-- 作者:zhuxinhui -- 发布时间:2021/6/26 10:34:00 -- 多谢 |
-- 作者:zhuxinhui -- 发布时间:2021/6/26 11:27:00 -- 提示:.NET Framework 版本:4.0.30319.42000
我将它转为备注后,就没有弹出这窗口了 |
-- 作者:有点蓝 -- 发布时间:2021/6/26 11:33:00 -- 调试技巧:http://www.foxtable.com/webhelp/topics/1485.htm,看哪一句代码出错 |
-- 作者:zhuxinhui -- 发布时间:2021/6/26 12:46:00 --
会有提示出来 |
-- 作者:zhuxinhui -- 发布时间:2021/6/26 13:00:00 -- 解决了 |