Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seiko Label Printer
Message
From
15/01/2003 12:40:09
 
 
To
15/01/2003 10:24:45
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00741905
Message ID:
00742011
Views:
18
Hi Charles,

After I strip out all of the stuff in my reports before deployment, I only have the following in the EXPR field:
ORIENTATION=0
COPIES=1
To strip my reports, I use a slightly modified version of Yuri's code to do it:
* Yuri Rubinov July 2000
* Remove printer specific setting in report form
*---------------------------------------------------

PARAMETER pRepoForm
CLEAR
LOCAL lcdefault, llokay
lcDefault=UPPER(SYS(2003))

IF TYPE("pRepoForM")#"C"
	LOCAL lcnewdefault
	lcnewdefault=GETDIR()
	IF !EMPTY(lcnewdefault)
		SET DEFAULT TO (lcnewdefault)
		pRepoForm="ALL"
	ELSE
		pRepoForm=GETFILE("frx")
	ENDIF
ENDIF

DO CASE
	CASE UPPER(pRepoForm)#"ALL"
		pRepoForm=LOWER(pRepoForm)
		IF NOT ".frx"$pRepoForm
			pRepoForm=pRepoForm+".frx"
		ENDIF
		IF NOT FILE(pRepoForm)
			pRepoForm=GETFILE("frx")
			IF NOT ".frx"$pRepoForm
				pRepoForm=pRepoForm+".frx"
			ENDIF
			IF NOT FILE(pRepoForm)
				=MESSAGEBOX("Report Form "+pRepoForm +" not found?!")
				RETURN
			ENDIF
		ENDIF
		DO iClean
	OTHERWISE
		*WHAT ABOUT PAGE Orientation?
		IF ADIR(aa,"*.frx")<=0
			=MESSAGEBOX("No *.frx Report Forms found?!")
			RETURN
		ENDIF
		FOR ia =1 TO ALEN(aa,1)
			pRepoForm=aa[ia,1]
			DO iClean
		ENDFOR

ENDCASE
llokay=IIF(UPPER(lcdefault)=UPPER(sys(2003)),.t.,.f.)
IF !llokay
    SET DEFAULT TO (lcdefault)
ENDIF
RETURN
*----------------------------------
PROCEDURE iClean

	CLOSE TABLE ALL
	USE (pRepoForm)
	WAIT WIND "Fixing Report form "+DBF() NOWAIT
	=AFIELD(afld)
	* the very first record only
	IF ASCAN(afld,"TAG")#0 AND ASCAN(afld,"TAG2")#0 AND ASCAN(afld,"EXPR")#0
		GO TOP
		*keep orientation and number of copies
		lcExpr1=""
          lcExpr = "COPIES=1"
		lcorient="ORIENTATION=0"
		IF "orientation"$LOWER(EXPR)
               lnOrientation = ATC("ORIENTATION", Expr)
               lcOrient="ORIENTATION" + ;
                        SUBSTR(Expr, ;
                        lnOrientation + 11, 02)
 		ENDIF
		IF "copies"$LOWER(EXPR)
			lcExpr=SUBSTR(EXPR,AT("copies=",LOWER(EXPR)),8)
		ENDIF
		lcExpr1=lcOrient+CHR(13)+lcExpr+CHR(13)
		REPLACE TAG WITH "", tag2 WITH "", EXPR WITH lcExpr1
		? "*******************"
		? EXPR
	ELSE
		=MESSAGEBOX("File "+pRepoForm+". Not VFP6 format?!")
	ENDIF

	USE
RETURN



*******************
DRIVER=winspool
DEVICE=\\NCSERVER\HP LaserJet 4000 Series PCL 6
OUTPUT=Ne02:
ORIENTATION=0
PAPERSIZE=1
PAPERLENGTH=2794
PAPERWIDTH=2159
COPIES=1
DEFAULTSOURCE=15
PRINTQUALITY=600
DUPLEX=1
YRESOLUTION=600
TTOPTION=2
*******************
LPARAMETERS cOutputName, nBuildAction, lRebuildAll, lShowErrors, lBuildNewGuids
LOCAL loCurrentProject
LOCAL lcOldALIAS
LOCAL lnCounter

loCurrentProject = APPLICATION.ActiveProject
lcOldALIAS = ALIAS()

WITH loCurrentProject
   WITH .Files
      SELECT 0
      WAIT WINDOW "Looking for FRXs to scrub . . ." NOWAIT
         FOR lnCounter = 1 TO .Count
             WITH .Item(lnCounter)
                  IF .Type = FILETYPE_REPORT
                     WAIT WINDOW "Scrubbing FRXs . . ." NOWAIT
                     USE (.Name) ALIAS ReportFRX
                     lcExpr = "COPIES=1"
                     lnOrientation = ATC("ORIENTATION", ReportFRX.Expr)
                     IF lnOrientation > 0
                        lcExpr = lcExpr + ;
                                 dHardReturn + ;
                                 "ORIENTATION" + ;
                                 SUBSTR(ReportFRX.Expr, ;
                                        lnOrientation + 11, 02)
                     ENDIF
                     REPLACE ReportFRX.Expr WITH lcExpr, ;
                             ReportFRX.TAG  WITH dNULString, ;
                             ReportFRX.TAG2 WITH dNULString
                     USE IN ReportFRX
                  ENDIF
             ENDWITH
         ENDFOR
         WAIT CLEAR
    ENDWITH
ENDWITH
IF NOT EMPTY(lcOldALIAS)
    SELECT (lcOldALIAS)
ENDIF
DODEFAULT(cOutputName, nBuildAction, lRebuildAll, lShowErrors, lBuildNewGuids)
>VFP 7 app uses a Seiko 200 USB label printer. Have it running successfully all over the place printing VFP labels (actually little landscape reports) on Win98 second edition. Now installing on an XP Pro box we get an error that the band it too large to fit and it will only print the labels if we scale them down to 50% (51% will not work) Exactly the same app, frx as the Win98 boxes. Cleaned Expr, Tag and Tag2 fields of the FRX. (every time I edit the reports on the laptop which has no Seiko driver I get HP stuff stuck in there)
>
>This was the Expr before I cleaned it. All I took out were the Device and Output references. I've tried Orientation of 0 and 1.
>
>DRIVER=winspool
>DEVICE=HP LaserJet 4
>OUTPUT=\\HAL\HP
>ORIENTATION=0
>PAPERSIZE=1
>COPIES=1
>DEFAULTSOURCE=265
>PRINTQUALITY=600
>YRESOLUTION=600
>TTOPTION=4
>
>Should I just take out everything else or are these needed? Do I need Device and Output references if I am doing a set printer to in the code?
>
>Thoughts appreciated.
.·*´¨)
.·`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"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform