Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer Tray Problems.
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Printer Tray Problems.
Miscellaneous
Thread ID:
00161522
Message ID:
00161522
Views:
56
FYI,

When saving a report the report will save your printer infomation. In most cases it's not bad, but when you are trying to select a tray not using the REPORT FORM TO PRINTER PROMPT, there is a problem. Printer and Tray information is kept with the report in the fields Expr, Tag, Tag2 in the first record of the report. When using the SYS(1037) to select a different printer and a tray the report is directed to the correct printer but not the correct tray. To correct this, right before I'm to build an executable I run the below procedure to remove the printer information. Happy programming. :)





*-Clears printer information for FoxPro report forms.
*-Ver 1.0
*-
*-Ask to proceed
IF MESSAGEBOX('This procedure will clear printer information stored in REPORT FORMS. You will be prompt to select a directory.'+CHR(13)+CHR(13)+'Do you want to continue?',4+32+256,'Attention!') = 7
WAIT WINDOW 'Process cancelled...' TIMEOUT .2
RETURN
ENDIF
*-Set Default.
lcoldpath = FULLPATH(SET('DEFAULT'))
SET DEFAULT TO ?
RELEASE Afrx
=ADIR(Afrx, '*.frx')

*-No report forms found
IF TYPE('Afrx') = 'U'
MESSAGEBOX('There were no report forms found.', 0+64,'Attention!')
SET DEFAULT TO (lcoldpath)
RETURN
ENDIF

*-Clear report forms
FOR i = 1 TO ALEN(Afrx,1)
WAIT WINDOW 'Processing file '+ALLTRIM(Afrx(i,1))+'...' NOWAIT
USE (Afrx(i,1)) IN 0 AGAIN ALIAS ReportForm
SELECT ReportForm
GO TOP
REPLACE EXPR WITH '', TAG WITH '', TAG2 WITH ''
USE IN ReportForm
ENDFOR
*-Set default back
SET DEFAULT TO (lcoldpath)

*-Reply
WAIT CLEAR
MESSAGEBOX(ALLTRIM(STR(ALEN(Afrx,1)))+' report forms have been processed successfully.', 0+64,'Clear Print Info')
Michael Garcia
Reply
Map
View

Click here to load this message in the networking platform