《通用简易报表打印程序(二).docx》由会员分享,可在线阅读,更多相关《通用简易报表打印程序(二).docx(6页珍藏版)》请在第壹文秘上搜索。
1、!通用简易报表打印程序(二)!-不能打印通用型和备注型字段内容SelTalkOffClearwjm-Getlc(db)Use&wjnr行数=0页数=Ia=Fcoun()1.ineS=25Pages=IiftMod(Runl().1.ineS)OJnl(Rxounl(),1.incS+l).RDinnsionName(八),widc(八)StoreIToi.ccDoWhileiaStoreFicld(iToNamc(i).tIfTypcf&C)=wNwide(i=Max(1.en(T).Fsize(Name(i)wide(i)=Iif(wide(i)2=Int(wide(i)2).wide(i)
2、wide(i)l)Elselflpc(&t)wide(i)=Iif(M(xl(wkie(i),2)=0wide(i).wide(il)EndifEndifi=ilEnddoEnd=i-1Hcad=Spacc(SO)18,30Say”请批入表名:,GetHeadReadi=lSizc=2DoWhilei=1.incS*2+l?1.i=lDoWhilei+HMEndif页数=页数+1行数=O1”EKet?Space(Size-1.en(TrinHHead)ZlH-HeadEndif?MilDoWhiIeiEnd?ReplicaieC-.widdi2)+,-ri=ilEnddo?RePIiCale1
3、.wideOV2)、-1”?Ii=lDoWhiIciIi=i+lEnddo行数=行数+2DoWhiIetf1.ineS*2l.Al.Not.EofO?,Hi=1DoWhileiEnd?RepIicateC-.wide(iy2)+i=i+lEnddo?RCPliCatC(一”,Widai*2)+“T-DOWhilei=EndlfTypc(,namc(i),)=,NT=SlrtT.wide(i)ElseIfTypCCnamC(旷尸射T=Dtoc(AT)ElseT=Namdi)EndifEndif?&Tlfljpe(,)=N?Spacc(widc(O-Esizc+HmElseIfTyPeC&l-)=
4、D”?IwElse?Spcc(widc(i)-Ixn(T)EndifEndifi=i+lEnddoSkipI行数=行数+2EnddoEnddoIf行数v1.ineS*2+lQ1.i=lDoWhiIciE11d?ReplicateC-.wide+共+Sir(Pagest2+页IfSizc60?SPaCdSiZC40)+”制表日期:“+Str(YCar(DatC().4)+“年+:STR(Month(Da侬),2)+月+SEDay(DatC(),21+“日”EndifQUHEndifSciPrintcrOffUseReturn !通用简易报表打印程序(三) !不能打印通用型和备注型字段内容 !*打
5、印字段可自由选择SetTalkOffClearWjm=GeIfilWdbDUse,Awj11行数=0页数=Ia=Fcount()1.ineS=25Pagcs=lif(Mod(Rcccount().1.incS)oOJnt(Rcccount()1.incS+l).Reccount(y1.incS)1,6Say请选择栏名05B3030DimensionName(八).wilc(八)Store1Ibi,ccDoWhileccaj=DWhilej=a-lj+1.11PromptFieIdG)j=jEnddo(Sa+2.llProtnpl”选择结束”Menu,occIfccaStoreFieId(CC)
6、TbName(i).IfDPCC&t*)=”NWidaii=MaX(1.Cn.FsizdNamc(D)wkic(i)=IIF(widc(i)2=INT(widc(i)2).widc(iwidc(i)l)ElselfTypc(,()=Dwide(i)=8Elsewidc(i)=Max(t).1.EN(t)Wide(i=Iif(Mod(wide2)=0.Widei),widel)EndifEndifElseIfi=IReturnElseExitEndifEndifi=ilEnddoEnd=i-1Hcad=Spacc(30)18,30Say”请位入友名:GetHeadReadi=lSizc=2DoW
7、hilei=EndSize=sizewide(i)+2i=i+lEnddoSetPrintOn?SPCE(Size-1.enTri11uHea=1.incs*2+l?”1.,i=lDoWhileiEn60?SPaC以Size60)+制表H期:+Str(Year(Da把0).4)+“年+;STR(Month(DaleO).2+月+Slr(Day(Dale().2+BEndif页数=页数+1行数=OQ*(Eject?Space(Size-1.en(TrinKHead)ZZH-HeadEndifi=lDoWhiIeiEl?RepIicaleC-,*.widdW2)+”丁i=i+iEiukio?Rep
8、lica(eC,-,*.wide(iy2)+-”?Ii=lDoWhiIci(i)+Space(wile(i)1.en(Na11)e(i)H-I,i=i+lEnddo行数=行数+2DoWhiIe行数1.ines*2+l.And.Not.EOfO?Hi=lDoWhileiEnl?RepIicateC-,wile(i)+i=i+lEnddo?RcpIicatcC-.widc(iy2)+H?Ii=lDoWhileipc(,namc(i)w=,Nt=S(r(t.wide(i)ElseIfryPC(namc(i=Dt=Dtoc(&t)Elset=Name(i)EndifEndif?&(lf1jpe(,A)=N?Spacc-l-cn(*,EndifEndifi=i+lEnddoSkipI行数=行数+2EnddoEnddoIftfft1.inest2lQ1.i=lDoWhiIci“页”IfSizc60?SPaeGSiZd60+制表日191:*+Str(YCar(DatCO),4计“年.+;STR(Momh(Da3)+“月Str(Day(DatcO),2)1.rEndifEndifSetPrinterOffUseReturn