>>expr field in first record of report for HPLJ 4L printer looks like:
>>
>>DRIVER=WINSPOOL
>>DEVICE=HP LaserJet 4L
>>OUTPUT=\\Marek\hp
>>ORIENTATION=0
>>PAPERSIZE=9
>>COPIES=1
>>DEFAULTSOURCE=1
>>PRINTQUALITY=300
>>YRESOLUTION=300
>>TTOPTION=2
>>
>>To print report properly, some lines of this info (DEFAULTSOURCE=)
>>must be removed,
>>otherwise when printing to some other printer, e.q. HPLJ 4P printer will try to select always incorrect (upper) tray!
>>But some lines (ORIENTATION=) must be remain untouched because they are set by report design!!
>>
>>Can somebody provide generic code to remove bad information from this
>>field? Some lines must be removed while some others not.
>>Can Tag and tag2 fields be blanked completely in first record?
>>Maybe to add this removing to genrepox?
>
>Tag,tag2 fields should be blanked completely. In Expr field delete driver/printer specific information (IMO, first three lines). I think it's better to do it manually.
Agree, Blank Tag, Tag2 is essential!!
If you sure which printer will be used in new system. You are better to use a
New property 'PrinterName' in form to hold the default printer!!
In FOrm designer, e.g. Thisform.PrinterName = "HP LaserJet 4L".
Then, when before printing, use the following code to load 1 time less on
printer driver!!
Lreport = "MyReport.frx"
APRINTER(APR)
IF THISFORM.PRINTERNAME == "" OR EMPTY(ASCAN(APR, THISFORM.PRINTERNAME))
PR = GETPRINTER()
THISFORM.PRINTERNAME = '&PR'
ELSE
SET PRINTER TO NAME (THISFORM.PRINTERNAME)
ENDIF
PRINTOPT = THISFORM.OPTPRINT.VALUE
DO CASE
CASE PRINTOPT = 1
REPORT FORM &LREPORT TO PRINTER NOCONSOLE
CASE PRINTOPT = 2
REPORT FORM &LREPORT PREVIEW
CASE PRINTOPT = 3
REPORT FORM &LREPORT TO ;
FILE $TREPORT.TXT ASCII
MODIFY COMMAND $TREPORT.TXT NOEDIT
DELETE FILE $TREPORT.TXT
WAIT IIF(FILE('$TREPORT.TXT'),'File not deleted','File deleted') WINDOW NOWAIT
ENDCASE
Of cos, it can be further enhance by using 'PRINTJOB... ENDPRINTJOB'.
But I have no time to study it... ~_~"
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.