Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Paper size - User defined (Tractor Feeder)
Message
From
03/04/2001 06:48:36
 
 
To
30/03/2001 08:32:12
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00490283
Message ID:
00491239
Views:
8
You might be able to do it by opening the report as a table and changing this info...

I was able to change the copies this way as below but try:
PAPERSIZE
PAPERLENGTH
PAPERWIDTH

instead of COPIES.
HOWTO: Programmatically Set the Number of Copies for a Report

----------------------------------------------------------------------------
----
The information in this article applies to:

Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0

----------------------------------------------------------------------------
----


SUMMARY
In Microsoft Visual FoxPro, there is no direct way to set the number of
copies to be printed. However, there are several ways to print multiple
copies. One is to print the report in a loop, but this is the slowest way to
do it. Another is to use the PROMPT keyword in the REPORT FORM command, but
this requires an extra user action, even if it is only hitting the ENTER
key. The most efficient way is to modify the .frx file directly to include
the proper number of copies.



MORE INFORMATION
The following code modifies a report to print the correct number of copies.
To use it, save the code to a new program (named MULTIREPO.PRG, for
instance) and call it from the Command window using this syntax:

DO MULTIREPO WITH [full path to report table],[number of copies wanted]
Example: DO MULTIREPO WITH "C:\MYREPORT.FRX", 2

The next time that report is printed, it prints out the number of copies you
specified.
LPARAMETER lcFRX, lnCopies
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 = "COPIES=" + ALLT(STR(lnCopies)) + vfCRLF
ELSE

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

ENDIF

REPLACE EXPR WITH lcNewExpr
USE IN (lcFRX)
Previous
Reply
Map
View

Click here to load this message in the networking platform