以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  DateTimePicker值为空时候的打印问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=34306)

--  作者:tungwun
--  发布时间:2013/6/4 22:48:00
--  DateTimePicker值为空时候的打印问题
DateTimePicker 代码打印日期,如没有加入日期会打印出01-01-0001请问如何不打印这样数字?

rl = new prt.RenderText
rl.Text = Format(CurRow("付款日期"),"dd-MM-yyyy")
rl.x = 154
rl.y = 59.5
rl.Style.Font = New Font("新細明體", 11, FontStyle.Bold) \'设置字体
rl.Style.FontBold = True \'字体加粗
doc.body.Children.Add(rl)


--  作者:lsy
--  发布时间:2013/6/5 5:50:00
--  

加个判断,看行不行:

If Forms("XXX").Controls("付款日期").Text > "" Then

    rl.Text = Format(CurRow("付款日期"),"dd-MM-yyyy")
Else
    rl.Text = ""
End If

--  作者:tungwun
--  发布时间:2013/6/5 22:43:00
--  谢谢

付款日期改为DateTimePicker 可用谢谢

If Forms("XXX").Controls("DateTimePicker").Text > "" Then

    rl.Text = Format(CurRow("付款日期"),"dd-MM-yyyy")
Else
    rl.Text = ""
End If