ucdos7.0 程序在 vfp6.0 下打印无法对齐
各位大侠公司的工资打印系统是在 ucdos7.0下编写的 都用了10几年了 还必须是在win98下运行 可98太落后了 用起来很不方便
于是在xp下搞了个98的虚拟机 勉强用着
最近想在vfp6.0下运行打印程序,可是程序在 vfp6.0 下打印无法对齐
还请各位大侠帮帮忙,看看哪里需要修改(以下为ucdos7.0下的打印程序源码),不胜感激!
红色部分老是对不齐,
标准格式
|基分| 生活费|岗位工资| 加 班 |年功|中夜餐|福 利|交通通讯|独子费|书报费|级别|保健费|
|280 | 68.00 |1259.00 | 536.00| 50 |100.00|17.00| 50.00 |5.00 |17.00 |50 |60 |
对不齐的格式
|基分| 生活费|岗位工资| 加 班 |年功|中夜餐|福 利|交通通讯|独子费|书报费|级别|保健费|
|280 | 68.00|1259.00|536.00| 50|100.00|17.00| 50.00|5.00 |17.00 |50 |60 |
源码
SET PRIN OFF
SET TALK OFF
SET DATE ANSI
wbh=0
QYH=1
ZYH=99
SELE 1
USE XTZK &&如果修改XTZK.DBF中 BH 的类型,程序将出错.
do while .t.
clear
@8,20 say '是否已执行JS3B程序?'
@12,20 SAY '编号为99时退出打印'
@13,20 say '单位编号:' GET WBH PICT '99'
READ
@16,20 say '开始页号:' GET QYH PICT '99'
@17,20 SAY '终止页号:' GET ZYH PICT '99'
READ
IF WBH=99
EXIT
ENDIF
SELE 1
LOCATE FOR BH=WBH
IF EOF()
@18,20 SAY '该单位不存在!'
?CHR(7)+CHR(7)
LOOP
ENDIF
IF WBH<10
I=STR(WBH,1)
ELSE
I=STR(WBH,2)
ENDIF
WNAME=NAME
WHD1=HD1
WHD2=HD2
@19,20 SAY '正在打印'+WNAME+'工资表'
SELE 2
USE GZZ&I
SET DEVICE TO PRINT
SET CONS OFF
SET PRINT ON
HH=1
* WQYH=17*(QYH-1)+1 && 一页打印 18 行
WQYH=24*(QYH-1)+1 &&打印 25 行
GO WQYH &&指向库中WQYH的记录
DO WHILE .NOT.EOF().AND.QYH<=ZYH
IF HH=1
do cr32401
* ?chr(27)+'IA'
?SPACE(30)+LTRIM(TRIM(WNAME))+'工资表'
DO CR32402
* ?CHR(27)+'IA'
?SPACE(10)+'打印日期:'
do tm
??'12'+SPACE(160)+'第'+STR(QYH,2)+'页'
ENDIF
?'...................................................................................................................................................................................................'
?yh1+' |基分| 生活费|岗位工资| 加 班 |年功|中夜餐|福 利|交通通讯|独子费|书报费|级别|保健费| '
??subs(whd1,1,10)+'|房水电|病事假|失业金|新工险|养老金|医 保| 个 税 |'
??SUBS(WHD2,1,6)+'|暖气费| 补 贴|实 发 数|'
?xm+space(12)+'|'
@prow(),pcol() say jf pict '@Z 9999'
??'|'
@prow(),pcol() say SHF pict '@Z 9999.99'
??'|'
@prow(),pcol() say FDGZ pict '@Z 99999.99'
??'|'
@prow(),pcol() say JBF pict '@Z 9999.99'
??'|'
@prow(),pcol() say GLGZ pict '@Z 9999'
??'|'
@prow(),pcol() say ZYC pict '@Z 999.99'
??'|'
@prow(),pcol() say FLF pict '@Z 99.99'
??'|'
@prow(),pcol() say CB pict '@Z 99999.99'
??'|'
@prow(),pcol() say DZF pict '@z 999.99'
??'|'
@prow(),pcol() say SBF pict '@Z 999.99'
??'|'
@prow(),pcol() say JIBGZ pict '@Z 9999'
??'|'
@prow(),pcol() say BJF pict '@Z 999.99'
??'|'
@prow(),pcol() say FJ pict '@Z999.99' &&烤火费
??' |'
@prow(),pcol() SAY FZSD pict '@Z 999.99'
??'|'
&& @prow(),pcol() SAY CX pict '@Z 9999'
&& ??'|'
@prow(),pcol() SAY BSJ pict '@Z 999.99'
??'|'
@prow(),pcol() SAY BXJ pict '@Z 999.99' &&失业保险金
??'|'
@prow(),pcol() SAY YYF pict '@Z 999.99' &&
??'|'
@prow(),pcol() SAY YLJ pict '@Z 999.99'
??'|'
@prow(),pcol() say hd3 pict '@z 999.99'
??'|'
@prow(),pcol() say hd7 pict '@z 99999.99' &&个税
??'|'
&&@prow(),pcol() say lc pict '@z 9999.99'
&&??'|'
@prow(),pcol() SAY HD2 pict '@Z 999.99'
??'|'
@PROW(),PCOL() SAY HD4 PICT '@Z 999.99'
??'|'
@PROW(),PCOL() SAY HD5 PICT '@Z 9999.99'
??'|'
@prow(),pcol() SAY SFGZ pict '@Z 99999.99'
??'|'
HH=HH+1
IF HH=25
HH=1
?'.....................................................................................................................................................................................................'
?' '
QYH=QYH+1
EJEC
ENDIF
SKIP
ENDDO
set print off
sum BJF,shf,fdgz,jbf,glgz,zyc,flf,cb,dzf,sbf,hd1,fzsd,bsj,bxj,hd2,sfgz,JIBGZ,yyf,ylj,fj;
to BJF1,shf1,fdgz1,jbf1,glgz1,zyc1,flf1,cb1,dzf1,sbf1,hd11,fzsd1,bsj1,bxj1,hd21,sfgz1,JIBGZ1,YYF1,ylj1,fj1
SUM HD3,HD4,HD5 TO HD31,HD41,HD51
sum hd6,hd7,hd8,lc to hd61,hd71,hd81,lc1
set print on
?'....................................................................................................................................................................................................'
?' 合计数 '+SPACE(11)+STR(SHF1,12,2)+' '+STR(JBF1,14,2)+STR(ZYC1,10,2)+STR(CB1,14,2)+' '+STR(SBF1,12,2)+' '+str(bjf1,10,2)+str(fj1,10,2)+' '+str(bxj1,14,2)+' '+str(ylj1,13,2)+str(HD31,7,2)+' '+str(hd41,17,2)+STR(sfgz1,19,2)
?space(22)+sTR(FDGZ1,19,2)+' '+STR(GLGZ1,10,2)+STR(FLF1,10,2)+STR(DZF1,16,2)+STR(jibgz1,15,2)+' '+STR(fzsd1,10,2)+STR(bsj1,10,2)+str(yyf1,11,2)+' '+str(hd71,16,2)+str(hd21,8,2)+' '+stR(HD51,12,2)
?' '
EJEC
SET DEVI TO SCRE
SET PRINT OFF
SET CONS ON
ENDDO
RETURN&&
*
*?