VisualFoxpro报表打印程序代码

上传人:碎****木 文档编号:292215660 上传时间:2022-05-13 格式:DOCX 页数:5 大小:12.24KB
返回 下载 相关 举报
VisualFoxpro报表打印程序代码_第1页
第1页 / 共5页
VisualFoxpro报表打印程序代码_第2页
第2页 / 共5页
VisualFoxpro报表打印程序代码_第3页
第3页 / 共5页
亲,该文档总共5页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《VisualFoxpro报表打印程序代码》由会员分享,可在线阅读,更多相关《VisualFoxpro报表打印程序代码(5页珍藏版)》请在金锄头文库上搜索。

1、 VisualFoxpro报表打印程序代码set talk offhh1=printstatus()set print ondo while .not.hh1?“打印机未预备好,请预备好打印机“hh1=printstatus()enddoset talk offset device to printcleara1=getfile(“dbf“) &翻开翻开文件对话框use “&a1“ &翻开指定的文件n1=fcount() &猎取翻开的库中的字段数dimension a(n1) &定义一个存放字段名的数组dimension b(n1) &定义一个存放字段宽度的数组k=1do while k=n1

2、a(k)=field(k)k=k+1enddo &将字段名赋给数组w=1do while w=n1b(w)=fsize(a(w) &猎取字段的长度if b(w)6b(w)=8elseb(w)=b(w)+2endifw=w+1enddodo while not eof()r1=1 &显示表头的第一行m=1col1=1do while m=n1if m=1r1,col1 say “+replicate(“-“,b(m)elseif m=n1r1,col1 say “+replicate(“-“,b(m)+“elser1,col1 say “+replicate(“-“,b(m)endifendif

3、col1=col1+b(m)m=m+1enddo m=1 &显示字段名行 col1=1do while m=n1if m=1r1+1,col1 say “+substr(a(m),1,6)+replicate(“ “,(b(m)-len(a(m)elseif m=n1r1+1,col1 say “+substr(a(m),1,6)+replicate(“ “,(b(m)-len(substr(a(m),1,6)+“elser1+1,col1 say “+substr(a(m),1,6)+replicate(“ “,(b(m)-len(substr(a(m),1,6)endifendifcol1=col1+b(m)m=m+1enddom=1 &由于字段多,一行不能完全显示整个行,因此分为两行显示字段名行col1=1do while m=n1if m=1r1+2,col1 say “+substr(a(m),7)elseif m=n1r1+2,col1 say “+substr(a(m),7)+replicate(“ “,(b(m)-len(substr(a(m),7)+“elser1+2,col1 say “+substr(a(m),7)endifendif

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 教育/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号