⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dycx.prg

📁 本工资管理系统由foxpro编写,可在VF下运行
💻 PRG
字号:
* -------------------------------------
* 程序名称: PDELREC.prg
* 功能说明: 查询结果显示、打印功能选择
* 数据库  : GZ.dbf gzhz.dbf gzxp.dbf
* -------------------------------------
set talk off

define window cxsub from 3,4 to 21,74  ;
 zoom shadow float color 4/7
activate window cxsub
move window cxsub cent
@1,16 say cxtj 
RCOL=1
@4,8 get push function "*nh \<1.显示;\<2.打印;\3.退出";
 default 1 color ,,,,,w+/b,r/b,gr+/b,w/b size 2,8,4
read cycle

do case
  case push=1
	sele 1
  *RCOL=1
    define window xscxjg from 3,4 to 21,74 zoom  float color 4/7
    activate window xscxjg
    move window xscxjg cent
	set format to &fmtname
    read
    set format to
    clear read
    deactivate window xscxjg
    release window xscxjg
  case push=2
    do dycxjg
  case push=3
    clear read 
	deactivate window cxsub
	release window cxsub
    return  
endcase
deactivate window cxsub
release window cxsub
return

 
 
procedure dycxjg

close all
define window printwindow from 6,10 to 16,68 zoom shadow float color 3/5
activate window printwindow
@2,8 say '请装好打印纸,按任意键继续!'
  @4,8 say '正在打印,请等待......'
sele 2
use &dbfname
copy stru to xgw extended
use xgw
clea
     bg1="┌"
     bg2="│"
     bg3="├"
     bg4="└"
 x=recc()
 dimension maxlen(x)
  for i=1 to recc()
   k=int(field_len/2)
    fieldsub=alltrim(field_name)
    lenfd=len(fieldsub)
    if lenfd>field_len
     maxlen(i)=lenfd
     k=int(len(fieldsub)/2)
     bg2=bg2+fieldsub+"│"
    else
      maxlen(i)=field_len
      bg2=bg2+space(field_len-len(fieldsub))+fieldsub+"│"
    endif
    for j=1 to k
     bg1=bg1+'─'
     bg3=bg3+'─'
     bg4=bg4+'─'
    next j
   bg1=bg1+"┬"
   bg3=bg3+"┼"
   bg4=bg4+"┴"
   skip
 next i
   
   bg1=substr(bg1,1,len(bg1)-2)+"┐"
   bg3=substr(bg3,1,len(bg3)-2)+"┤"
   bg4=substr(bg4,1,len(bg4)-2)+"┘"
use   

sele 1
set device to print
if printerok()
  set printer on
  set print to cxjg.txt
else
  deactivate window printwindow
  release window printwindow
  dele file xgw.dbf
  close all
  return
endif

    ?bg1
    ?bg2
    ?bg3
     bg5="│"
     for j=1 to fcount()
       s=type (field(j))
       x=field(j)
       a=&x
       do case
         case s='N'
         bg5=bg5+spac(maxlen(j)-len(alltrim(str(a))))+alltrim(str(a))+"│"
         case s="D"
         bg5=bg5+spac(maxlen(j)-len(dtoc(a)))+dtoc(a)+"│"
         case s="L"
         bg5=bg5+spac(maxlen(j)-2)+iff(a,"是","否")+"│"
         case s="C" or s="M"               
         bg5=bg5+spac(maxlen(j)-len(alltrim(a)))+alltrim(a)+"│"
       endcase
    next j
     ?bg5
     ?bg4
  eject


set print off
set devi to scre
@5,4 say "打印完毕!"
wait""
deactivate window printwindow
release window printwindow
dele file xgw.dbf
close all
return

function printerok
  inputkey=0
  do while inputkey<>27.and.(.not.printstatus())
     @2,8 say "警告:打印机没有准备好!"
     @3,8 say "请打开打印机并按任一键继续,"
     @4,8 say "-----按ESC键退出"
     inputkey=inkey(0)
  enddo
  return (inputkey<>27)
       

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -