主题:请高手帮忙加入打印日期的代码
按照原代码打印,“年月”可以打印,就是“日”没有打印出,请高手看看原代码帮忙修改一下,是否日期代码没有?
原代码:
rest from sxjj addi
h_d=val(m_day)
h_d1=h_d-1
h_mm=thisform.text3.value
yzdm=thisform.text1.value
year1=thisform.text2.value
h_m1=val(thisform.text3.value)
year2=thisform.text4.value
h_m2=val(thisform.text5.value)
if h_m2=12
h_m3=01
year2=allt(str((val(year1)+1),4))
else
h_m3=h_m2
endif
if len(allt(thisform.text1.value))#7.or.val(year1)<1994.or.h_m1<1.or.h_m2<1.or.h_m1>12.or.h_m2>12.or.h_m1>h_m2
=messagebox("数据输入错误,按任意键重输......",0+48,"提示")
thisform.text1.setfocus
retu
endif
thisform.label4.visible=.t.
thisform.refresh
hwk="w"+allt(year1)+".dbf"
hjk="j"+allt(year1)+".dbf"
if file(hwk)
sele 2
use sfjck orde sfjckyzh
sele 1
use &hwk
repl all wxfy with 0,wxfy_s with 0
set rela to yzh into b
repl all yclbj with b->yclbj for yzh=b->yzh
for i=h_m1 to h_m2
hwfy="fy"+allt(str(h_m1))
hwfs="fys"+allt(str(h_m1))
hycl="yclbj"+allt(str(h_m1))
*repl all wxfy with &hwfy+wxfy,wxfy_s with &hwfs+wxfy_s for &hycl="1".and.left(yzh,7)=yzdm
repl all wxfy with &hwfy+wxfy,wxfy_s with &hwfs+wxfy_s ,&hycl with "1" for yclbj="1".and.left(yzh,7)=yzdm
h_m1=h_m1+1
endfor
copy fiel yzh,r,n,z,h,s,wxfy,wxfy_s to ls for left(yzh,7)=yzdm.and.(wxfy#0.or.wxfy_s#0)
use ls
max1=recc()
SUM ALL WXFY,WXFY_S TO T1,T2
else
=messagebox("数据库"+hwk+"不存在,按任意键重输......",0+48,"提示")
thisform.text1.setfocus
retu
endif
use &hjk
h_m1=val(thisform.text3.value)
repl all wxfy with 0
for i=h_m1 to h_m2
hwfy="jff"+allt(str(h_m1))
repl all wxfy with &hwfy+wxfy for yzh=yzdm
h_m1=h_m1+1
endfor
copy fiel yzh,wxfy to ls for wxfy#0.and.yzh=yzdm
use ls
SUM ALL WXFY TO T3
hj=t1+t2+t3
if hj=0
=messagebox("本次没有可供打印的数据产生!",0+48,"提示")
close all
dele file ls.dbf
retu
else
if recc()=0
appe blank
endif
yzmc=allt(thisform.text6.value)
sys(1037)
report form hzb preview
endif
thisform.label4.visible=.f.
原码及表单附件在上面
原代码:
rest from sxjj addi
h_d=val(m_day)
h_d1=h_d-1
h_mm=thisform.text3.value
yzdm=thisform.text1.value
year1=thisform.text2.value
h_m1=val(thisform.text3.value)
year2=thisform.text4.value
h_m2=val(thisform.text5.value)
if h_m2=12
h_m3=01
year2=allt(str((val(year1)+1),4))
else
h_m3=h_m2
endif
if len(allt(thisform.text1.value))#7.or.val(year1)<1994.or.h_m1<1.or.h_m2<1.or.h_m1>12.or.h_m2>12.or.h_m1>h_m2
=messagebox("数据输入错误,按任意键重输......",0+48,"提示")
thisform.text1.setfocus
retu
endif
thisform.label4.visible=.t.
thisform.refresh
hwk="w"+allt(year1)+".dbf"
hjk="j"+allt(year1)+".dbf"
if file(hwk)
sele 2
use sfjck orde sfjckyzh
sele 1
use &hwk
repl all wxfy with 0,wxfy_s with 0
set rela to yzh into b
repl all yclbj with b->yclbj for yzh=b->yzh
for i=h_m1 to h_m2
hwfy="fy"+allt(str(h_m1))
hwfs="fys"+allt(str(h_m1))
hycl="yclbj"+allt(str(h_m1))
*repl all wxfy with &hwfy+wxfy,wxfy_s with &hwfs+wxfy_s for &hycl="1".and.left(yzh,7)=yzdm
repl all wxfy with &hwfy+wxfy,wxfy_s with &hwfs+wxfy_s ,&hycl with "1" for yclbj="1".and.left(yzh,7)=yzdm
h_m1=h_m1+1
endfor
copy fiel yzh,r,n,z,h,s,wxfy,wxfy_s to ls for left(yzh,7)=yzdm.and.(wxfy#0.or.wxfy_s#0)
use ls
max1=recc()
SUM ALL WXFY,WXFY_S TO T1,T2
else
=messagebox("数据库"+hwk+"不存在,按任意键重输......",0+48,"提示")
thisform.text1.setfocus
retu
endif
use &hjk
h_m1=val(thisform.text3.value)
repl all wxfy with 0
for i=h_m1 to h_m2
hwfy="jff"+allt(str(h_m1))
repl all wxfy with &hwfy+wxfy for yzh=yzdm
h_m1=h_m1+1
endfor
copy fiel yzh,wxfy to ls for wxfy#0.and.yzh=yzdm
use ls
SUM ALL WXFY TO T3
hj=t1+t2+t3
if hj=0
=messagebox("本次没有可供打印的数据产生!",0+48,"提示")
close all
dele file ls.dbf
retu
else
if recc()=0
appe blank
endif
yzmc=allt(thisform.text6.value)
sys(1037)
report form hzb preview
endif
thisform.label4.visible=.f.
原码及表单附件在上面