Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing
Message
De
21/03/2005 15:07:40
 
 
À
21/03/2005 13:52:56
John Fitzgerald
Kenneths Hair Salons & Day Spas,Inc.
Columbus, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00997273
Message ID:
00997933
Vues:
16
Yes, copy the report and make your changes. Then use the changed table as the report. Here is an example:
*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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform