Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to turn off Printer Environment?
Message
De
03/11/2008 14:41:06
 
 
À
03/11/2008 14:00:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01359237
Message ID:
01359243
Vues:
20
>I need to modify about 300 reports in the way that they don't save current printer information.
>It can be done manually by unchecking the "Printer Environment" option in Report menu.
>I also can erase printer info by running code
>
>SELECT 0
>USE (myreport.frx)
>LOCATE FOR (objtype = 1) AND (objcode = 53)
>IF FOUND()
> REPLACE expr WITH SUBSTR(expr, AT( "ORIENTATION", expr)), ;
> tag WITH "", ;
> tag2 WITH ""
>ENDIF
>
>Is there a way to turn off "Printer Environment" for report MYREPORT.FRX by modifying a field directly in the table MYREPORT.FRX.?
>
>Thanks
>
>Ed
Private lcFilename, lcStore, lcAlias,lnLength,lnTemp,lcCaption,temp,words
#DEFINE CRLF CHR(13)+CHR(10)
lcAlias=SELECT()
lcCaption=_VFP.CAPTION
dimension TEMP(1,1)
dimension WORDS(3)
WORDS(1)='DRIVER='
WORDS(2)='DEVICE='
WORDS(3)='OUTPUT='

CD reports

do RemovePrinterInfo with 'FRX'
do RemovePrinterInfo with 'LBX'

CD ...
use
_VFP.CAPTION = lcCaption

select (lcAlias)
PROCEDURE RemovePrinterInfo
	LPARAMETERS lcFilter
	lcFilter='.'+lcFilter

	lnDatabases = ADIR(laDatabases, '*'+lcFilter)  && Create array

	FOR nCount = 1 TO lnDatabases
		lcFilename = STOR1(STRTRAN(laDatabases(nCount,1), lcFilter))
		_VFP.CAPTION = "Fixing " + lcFilename + lcFilter
		USE (lcFilename+lcFilter) IN 0 EXCLUSIVE
		SELECT (lcFilename)
		lnLength=ALINES(TEMP,EXPR)
		FOR EACH lnTeller in WORDS
			lnTemp=ASCAN(TEMP,lnTeller)
			IF lnTemp>0
				ADEL(TEMP,lnTemp)
				lnLength=lnLength-1
			ENDIF
		ENDFOR
		lcStore=''
		FOR EACH lnTeller in TEMP
			IF VARTYPE(lnTeller)='L'
				EXIT
			ENDIF
			IF LEN(lcStore)>0
				lcStore=lcLagre+CRLF
			ENDIF
			lcStore=lcStore+lnTeller
		ENDFOR
		REPLACE EXPR WITH lcStore, TAG WITH "", TAG2 WITH ""
		? "Deleted from " + lcFilename
		USE
	ENDFOR
ENDPROC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform