>>>Hi,
>>>
>>>I being using vfp3a and vfp5a to create application. But when it come to printing of report, the alignment is always out when I change the printer driver to another printer or my application had to be change to another system using another printer. I know it is due to the vfp saving our default printer in the frx file.
>>>
>>>Therefore, I would like to know what is the best method or ways so that whenever I change the printer driver, my application will automatic change with me so that I do not had to change the frx file manual if I had lot of customer to support.
>>>
>>>Any suggestion or advise is very much appreciated. Thank you.
>>
>>Open your Report file as a table (USE MyReport.frx) and edit the first record. Empty the TAG and TAG2 fields. Open the EXPR field (it's a memo field) and delete all references to a particular printer, leaving lines about the orientation and paper size.
>>
>>Now VFP will use the default printer instead of the printer used in developing the report.
>>
>>Unfortunately, you will have to do this for every report you write - and do it whenever you change the report.
>>
>>Barbara
>
>Barbara--
>Is there any way to make the changes programmatically? I have a macro that builds my exe file from the project and puts it in the proper directory. Perhaps I could add some sql that edited the frx file. No?
>
>--Chris Lawrence
Barbara, Pls put it into FAQ knowledge Base! Thanks!
* File: CleanFrx.Prg, To remove Printer Information in Current directory!
nFileCount = ADIR(frxFile,"*.frx")
IF nFileCount = 0
MessageBox("No .Frx File is found at "+CURDIR(),0+32,"What a Pity!")
RETURN .F. && Why .f. - on purpose ?
ENDIF
for iCount = 1 to nFileCount
use frxFile[iCount,1] && Dirinfo is two dimensional
blank fields expr, tag, tag2 && Blank to remove printer driver info
Wait "Cleaning "+ frxFile[iCount,1] Window NoWait
if "PLAN" $ frxFile[iCount,1]
* Plan.frx need Orientation=1 means Print in LandScape
replace expr with "ORIENTATION=1"
endif
use && As Barbara pointed out always the first record
ENDFOR
WAIT WINDOW "All Bomber .Frx File(s) in "+CURDIR()+" have been Fixed!!" NOWAIT NOCLEAR
What you need to do is to call this prg before compile....
use below Compile.prg:
CLEAR ALL
CLOSE ALL
OPEN DATABASES LOVELYHM EXCLUSIVE
PACK DATABASES
SET EXCLUSIVE OFF
CLEAR ALL
CLOSE ALL
IF FILE('CLEANFRX.PRG')
DO CLEANFRX.PRG
ENDIF
&& Auto Call Compile!
KEYBOARD '{ALT+F}'
KEYBOARD '1'
KEYBOARD '{ALT+D}'
KEYBOARD '{ALT+E}'
KEYBOARD '{ENTER}'
So, when I run the compile() , it will pack database and clean all frx files!!
Of cos, I need to Press [Enter] to confirm Generate Executable file!
^-^; Of cos I am Lazy ma... hee hee!
Barbara, I still have this problem after erase the printer information.
For Espon Printers, LQ570+, LQ1070, LQ1170, LQ2170...
They can't printer first line! All the information will start print at Top 5mm!
But HP printers can print at first line....
I got serious problem on printing Pre-Printed Invoice Sheet!!! ~~>.<~~
Besides, for LQ570+ and LQ1070, the custom paper calculation are different...
LQ570+ with same install driver will print 3 cm more per page for custom paper size!! Totally out of my control even I change the
expr value in every .frx file! What should I do then!?
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.