Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing custom paper size in report
Message
 
À
13/11/2002 21:23:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00722472
Message ID:
00723539
Vues:
29
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform