Friday, June 10, 2011

VFP: Custom paper size cannot be used at deployment

Issue:
Already setup custom paper size on [Print] Server Properties but it won't come into effect in the program

Solution 1:
- Report Designer > Page Setup > UNcheck Save printer environment
- save and close it
- "use" and "browse" report file (.frx)
- locate record with Objtype=1 and Objcode=53
- edit "Expr" field: remove "PAGESIZE=..." line
- at customer's computer:
Set Paper Size on Printer's Advanced Properties to the one desired

Solution 2:
- Getting PaperSize ID programmatically
http://hermantan.blogspot.com/2008/03/getting-papersize-id-programmatically.html
- Modify report's Papersize at runtime:
USE .frx
LOCATE FOR Objtype = 1 AND Objcode = 53
lcNew = "PAPERSIZE=9"
lcOld = "PAPERSIZE=41"
REPLACE expr WITH STRTRAN(Expr,lcOld,lcNew)
USE

Other useful tip:
Adding Custom Paper Size Programmatically
http://hermantan.blogspot.com/2007/08/adding-custom-paper-size.html

No comments:

Post a Comment