Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wanted to share what I have found
Message
De
07/04/1999 17:56:37
Pamela Bulmahn
The University of Iowa
Iowa, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Wanted to share what I have found
Divers
Thread ID:
00206265
Message ID:
00206265
Vues:
56
For those of you who are suffering through the pangs of converting FP 2.6 DOS to VFP and are having major problems with printing, I have finally resolved my issues and I thought I would share them with you.

First I have a large production system (some 400 module, most with some kind of print routine) and I needed to get it out of DOS for Y2K issues related to DOS not FP 2.6. The system was started more than 10 years ago so several of the techniques have carried forward from previous versions. The reports are printed using @ Prow()...Say statements with built in escape code sequences for print formatting (dependent on the printer selected) and the user has the option of picking one of 20 printers on a Novell network. I used a printer selection program with capture statements built into the code. Well needless to say neither the escape codes nor the capture statements would work as desired in a straight conversion.

Using several articles from MS KB, "FoxTalk" and "FoxPro Adviser" I have come up with the following solutions:
1. I wrote a conversion program to change standard code in the DOS programs to work better in VFP.
2. I changed the SET DEVICE TO PRINT to SET DEVICE TO FILE PRTFILE.PRN
3. The program sends the printed output with escape codes to the .prn file as if it was a printer.
4. I wrote a program to actually print the .prn file on the desired printer by using the API WNet...Connection calls to change the connection to the LPT1 device with the statement COPY FILE PRTFILE.PRN TO LPT1.DOS
5. Finally I added a line to the bottom of the report program that called the print utility and voila it seems to work fine.

I have tested this on a Win95 computer with old Client32, and a Win98 computer with new Client32 and it looks good so far.

If you would be interested in the code or have additional suggestions please reply. I hope this will help other with the same tasks ahead.
Pamela.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform