Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing custom paper size in report
Message
 
To
13/11/2002 21:23:17
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00722472
Message ID:
00723539
Views:
26
If your printer allows custom sizes, create a custom size in your printer driver and you can change your report on-the-fly with this code (using it prio to running the report and resetting it after if you need to):
DO CHANGESIZE WITH "C:\myreport.FRX", 5 && Change to legal size or whatever the number is for the custom size.

FUNCTION CHANGESIZE
LPARAMETER lcFRX, lnSize
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 = "PAPERSIZE=" + ALLT(STR(lnSize)) + vfCRLF
ELSE

    lnStartCopiesLine = ATC("PAPERSIZE", 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 + "PAPERSIZE=" + ALLT(STR(lnSize)) + lcBottom

ENDIF

REPLACE EXPR WITH lcNewExpr
USE IN (lcFRX)
ENDFUNC
>hi all, how do i passing width and height in custom paper size automaticly
>in my aplication.
>thank's
Previous
Reply
Map
View

Click here to load this message in the networking platform