Re: Change of Paper size programatiically by Mike
Mike
Mon Jan 10 04:25:07 CST 2005
Do you mean how to change paper tray programmtically? If so you'll need to
hack your report (use your report like a table and change the DEFAULTSOURCE
value. Here is an example
DO CHANGETRAY WITH "C:\myreport.FRX", 1 && OR WHATEVER TRAY YOU WANT
FUNCTION CHANGETRAY
LPARAMETER lcFRX, lnTray
LOCAL lcNewExpr, lnStartCopiesLine, lcStartAtCopiesLine, lnEndCopiesLine ;
lnLenCopiesLine, lcTop, lcBottom
#DEFINE vfCRLF CHR(13) + CHR(10)
IF !(UPPER(RIGHT(lcFRX, 4)) = ".FRX")
lcFRX = lcFRX + ".FRX"
ENDIF
USE (lcFRX)
LOCATE FOR objType = 1 AND objCode = 53
IF EMPTY(EXPR)
lcNewExpr = "DEFAULTSOURCE=" + ALLT(STR(lnTray)) + vfCRLF
ELSE
lnStartCopiesLine = ATC("DEFAULTSOURCE", EXPR)
lcStartAtCopiesLine = SUBSTR(EXPR, lnStartCopiesLine)
lnEndCopiesLine = ATC(vfCRLF, lcStartAtCopiesLine)
lnLenCopiesLine = LEN(SUBSTR(lcStartAtCopiesLine, 1, lnEndCopiesLine))
lcTop = SUBSTR(EXPR, 1, lnStartCopiesLine - 1)
lcBottom = SUBSTR(EXPR, (LEN(lcTop) + lnLenCopiesLine))
lcNewExpr = lcTop + "DEFAULTSOURCE=" + ALLT(STR(lnTray)) + lcBottom
ENDIF
REPLACE EXPR WITH lcNewExpr
USE IN (lcFRX)
ENDFUNC
"Hughs Man" <hughs@easystem-hk.com> wrote in message
news:OwEe75u9EHA.2876@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I am using VFP6.0 with Windows XP for a system with Multi-USer
> I got a report using a Paper Size - Letter.
> But on some computer the paper size will change depending on the setting
> of the computer
> Is there any ways to set the paper size of the report before REPORT FORM
>
> Regards,
> Hughs Man
>
>