General information
Category:
Reports & Report designer
Title:
Default Printer hardcoded in report
Whenever I use File / Page Setup / Print Setup in the VFP Report Designer to set page settings -- such as Landscape -- in a report, my default printer gets stored as the default for the report, overriding the user's default printer. I created the program below to clear the printer from the report file as recommended by the Microsoft KB, however, I lose the Landscape setting in the process. How can I prevent the printer from being stored in the first place or flexibly "scrub" only the default printer setting from my report file? Any insight would be greatly appreciated. Thanks, Scott
* Remove specific printer settings from given report file so report will print
* to the user's default Windows printer. See Microsoft KB Article #Q138396 for
* more information about this.
PARAMETERS cReportFile
IF TYPE("cReportFile") <> "C"
MESSAGEBOX('No report name supplied.' + CHR(13) + 'Command format:' + CHR(13) + CHR(13) + ' DO DEFPRINT WITH "myreport"')
ELSE
cFile = IIF(ATC(".frx",cReportFile)==0,ALLTRIM(cReportFile)+'.frx',cReportFile)
IF FILE(cFile)
USE (cFile)
LOCATE FOR ObjType == 1 AND ObjCode == 53
IF FOUND()
REPLACE Tag WITH ""
REPLACE Tag2 WITH ""
REPLACE Expr WITH ""
ELSE
MESSAGEBOX("Printer settings record not found.")
ENDIF
USE
MESSAGEBOX("Report <"+cFile+"> updated.")
ELSE
MESSAGEBOX("Report <"+cFile+"> does not exist.")
ENDIF
ENDIF
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only