>>>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!!
>>>
>>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.
>
>I have a program with 150 frx reports designed in A4 format
>in Porttrait and if some report will not fit, in Landscape
>orientation. This is the only vital property of reports which must
>be preserved.
>
>This program will be distributed to many users and i dont
>know which printer they have. Also, sometimes they modify reports
>(this causes printinfo to appear again) and sometimes they change printers,
>different workstations using same report may have different printers.
>In some cases i got phone calls telling that after changing printer report
>stops working since it tries get paper from incorrect source.
>
>Thus the only way to handle this is to clear .frx file
>always before printing programmatically.
>
>Firs three lines seems not to cause printer errors since
>foxpro or windows seem to ignore them when there unmatched information.
>
>The critical field which causes report not to be printer is
>in line 7, DEFAULTSOURCE=
>
>Is it sufficient to delete always line number 7 (without checking,
>deleting only by number) from expr field
>and blank tag and tag2 ?
>I want to print always to default printer set from control panel.
Well, I also got your problem. ~~>_<~~ As different printer, the print
margin is different. I got alright on printing label to fit the Label paper
first row... but half cut on 1st row on client Printer....
For blanking the 150 frx file printer info.
try this coding:
nFileCount = ADIR(frxFile,"*.frx")
IF nFileCount = 0
MessageBox("No .Frx File is found at "+CURDIR(),0+32,"What a Pity!")
RETURN .F.
ENDIF
for iCount = 1 to nFileCount
use frxFile[iCount,1]
blank fields expr, tag, tag2
Wait "Cleaning "+ frxFile[iCount,1] Window NoWait
if "PLAN" $ frxFile[iCount,1]
replace expr with "ORIENTATION=1"
endif
use
ENDFOR
MessageBox("All Bomber .Frx File(s) in "+CURDIR()+" have been Fixed!!",;
0+32,"Have A Nice Day!")
^_^; I think I need to post this coding in FAQ!
But first ask Cetin as he did this coding first... (Copy Right ma) =)
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.