*PrintRep.prg PARAMETER sReportName, forclause, prescope, iLength, iBottomarg, iNumCopies, bCondensed IF EMPTY(sReportName) RETURN ENDIF PRIVATE xrep, mforclause, iWidth mforclause = .T. iWidth = 80 IF EMPTY(forclause) forclause = "mforclause" ENDIF IF EMPTY(prescope) prescope = 'ALL' ENDIF IF EMPTY(iLength) iLength = 0 ENDIF IF EMPTY(iBottomarg) iBottomarg = 0 ENDIF IF EMPTY(iNumCopies) iNumCopies = 0 ENDIF xrep=REPTMODI(sReportName, iLength, iBottomarg, @iWidth, iNumCopies) IF !EMPTY(xrep) m.canceled = .F. SET ESCAPE ON ON ESCAPE m.canceled = yesno("Cancel Printing?",5) REPORT FORM (xrep) &prescope WHILE NOT m.canceled FOR &forclause TO PRINTER NOCONSOLE SET CONSOLE ON ON ESCAPE SET ESCAPE OFF DELETE FILE (xrep+".frx") DELETE FILE (xrep+".frt") ELSE DO OKAY WITH 'REPORT FORM NOT FOUND: '+sReportName ENDIF *----------------------------------- *--ReptModi.prg PROCEDURE ReptModi PARAMETER xreport,pagesize,bottmarg,ywidth,iCopies private newname,crntalias crntalias = ALIAS() newname = tdir+SYS(3) SELECT 0 USE (xreport+".frx") COPY TO (newname+".frx") * Check to see if file was created and then process IF FILE(newname+".frx") USE (newname+".frx") SCAN IF OBJTYPE = 1 IF !EMPTY(pagesize) REPLACE HEIGHT WITH pagesize ENDIF IF !EMPTY(bottmarg) REPLACE BOTMARGIN WITH bottmarg ENDIF IF !EMPTY(iCopies) AND TYPE('EXPR') <> 'U' REPLACE EXPR WITH STRTRAN(EXPR, 'COPIES=1', 'COPIES=' + ALLTRIM(STR(iCopies))) ENDIF ywidth = WIDTH EXIT ENDIF ENDSCAN USE ELSE newname = "" ENDIF IF !EMPTY(crntalias) SELECT (crntalias) ENDIF RETURN newname