小弟今天也遇到同样的问题,要打印每个学生的成绩,每个人独立成为一个表单,用80行3联打印纸输出,在换纸上遇到问题,代码如下:
clear
set alte to print.txt
set alte on
set cons off
use nhcj
go top
do while .not. eof ()
n=1
do while n<=7
? ' _____________________________________________________________________________'
? '| |'
? '| 准考证号码 考生姓名 政治 语文 数学 英语 物理 化学 体育 七科总分 |'
? '| |'
? '| '+number,space(2),name,str(polit,3),space(1),str(chine,3),space(1),str(maths,3),space(1),str(engli,3),space(1),str(physi,3),space(1),str(chemi,3),space(1),str(sport,3),space(3),str(scores,3),space(6)
??'|'
? '|_____________________________________________________________________________|'
? ''
if .not. eof()
skip
endif
enddo
h=h+10
enddo
use
set alte to
set cons on
clear
set alte to print.txt
set alte on
set cons off
use nhcj
go top
do while .not. eof ()
n=1
do while n<=7
? ' _____________________________________________________________________________'
? '| |'
? '| 准考证号码 考生姓名 政治 语文 数学 英语 物理 化学 体育 七科总分 |'
? '| |'
? '| '+number,space(2),name,str(polit,3),space(1),str(chine,3),space(1),str(maths,3),space(1),str(engli,3),space(1),str(physi,3),space(1),str(chemi,3),space(1),str(sport,3),space(3),str(scores,3),space(6)
??'|'
? '|_____________________________________________________________________________|'
? ''
if .not. eof()
skip
endif
enddo
h=h+10
enddo
use
set alte to
set cons on
IF LASTKEY() = 27
RETURN
ENDIF
IF MESSAGEBOX(' 打印机没有准备好, 继续吗? ',36,'') = 6
LOOP
ELSE
RETURN
ENDIF
ENDDO
SET ESCAPE ON
ON ESCAPE RETU
REPORT FORM &repo_file TO PRINT NOCONSOLE
SET ESCAPE OFF如果不是VFP就比较麻烦,恐怕打印纸格式要用打印机命令或特殊打印命令(如UCDOS提供的)才能实现。打印到最后一页后还要增加一条换页命令,将打印机缓冲清空才能打印出最后一页。
用表格很容易呀,你在细节区里画线不就行了
用表格很容易呀,你在细节区里画线不就行了
UP! :)