Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When to Remove Contents of EXPR, TAG and TAG2
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00742756
Message ID:
00743127
Vues:
28
Thank you so much!
Very nifty utility.
Am I correct in saying that other settings such as # of copies are not retained?


Terry went ahead and saved all of the "good" settings and then copied those back into the expr field. The other approach is to remove the "bad" settings: DEVICE, OUTPUT and DRIVER. I'll post the code below (the good thing about posting code is that if you make a mistake, someone will point it out!).
lcReportDir=zgetDir('Get Report Folder')  && zGetDir is the api getfolder stuff -- use getdir() instead.
If not empty(lcReportDir)
  lcReportDir=addbs(lcReportDir)
  lnReports=adir(laFRXfiles,lcReportDir+"*.frx")
  For nFrxCounter= 1 to lnReports
    wait window nowait "Report Number " + transform(nFrxCounter)
    lcReportFile=lcReportDir+laFRXfiles(nFrxCounter,1)
    Use (lcReportFile) in 0 alias frxReport
    Select frxReport
    Locate FOR objtype = 1 AND objcode = 53
    If FOUND()
*!*	Find out how many lines in memo field. Find mline for DEVICE, OUTPUT, DRIVER delete these lines
	m.memolines= memlines(expr)
	nDeviceline=atcline("DEVICE=",expr)
	nOutputLine=atcline("OUTPUT=",expr)
	nDriverline=atcline("DRIVER=",expr)
	m.NewExpr=""
	For i = 1 to m.memolines
          If i#nDeviceline and i#nOutputLine and i#nDriverline
 	    m.NewExpr=m.NewExpr + mline(expr,i) +chr(013)
 	  Endif
	Endfor   && m.memlines
	Replace expr with m.NewExpr
	Replace tag WITH ""
	Replace tag2 WITH ""
	Endif   (Found())
     Use in frxReport

   Endfor (nFrxCounter)

Endif  (not empty(lcReportFile)
wait clear
wait window "Resetting Report default printer options completed"
Kevin Emmrich
www.jkt9000.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform