ORIENTATION=0 COPIES=1To 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)