Foxpro stores the printer information i.e., printer name, orientation, paper tray, paper size etc., as well as the actual default printer driver which was in use on the computer used by the developer of the report. So, you can either determine which printer driver you need to install which includes the file 'HPFDJC02.DRV', or you can 'fix' the report files themselves, provided they are standalone and not built into the executable.
To do this, first make a backup, then open the report file as a table using USE MyReport.FRX and BROWSE it. The very first record in the table contains printer info only. Tab to the Expr memo field and open it. You can remove anything that references a specific printer or print queue, but you can leave any other lines having to do with other properties such as orientation, paper, copies, etc.
Next, tab to the Tag memo field and open it. It will look like a jumble of junk characters with maybe some readable text. Totally empty that field out. Do the same with the Tag2 field. Close the table and try running the report again.
This program is for distribution and so needs to work with the default printer on the user's machine. I found the HPFDJ file on the HP site and placed it with all the other .drv files in Windows. That did not solve the problem. Does it actually need to be installed?
The HPFDJ file is for an HP DeskJet and to the best of my knowledge we have never had one in the office when this application was developed. So I assume HP must have used that .drv as part of the driver package for a non Desk Jet printer. We have Laser Jets
I have explored the .frx files. The expr cells were all empty and there was a grab bag of printer drivers including some "HPFDJ" and garbage "characters" in some of the Tag cells.
In your first e-mail you said "provided they are standalone" they can be fixed. And if they are not? Since this is for distribution and I have to build the executable will emptying the Tags work or will the references to HPFDJ simply return when I build the executable again?
No. If you remove any references to it in the .FRX, you can use any printer driver.
..."provided they are standalone" they can be fixed. And if they are not?
What I meant was, as long as the reports were not already included into a distributable .EXE, you could modify them. If this was an app someone had already compiled, you wouldn't be able to access the report files themselves. As long as it's an application you are distributing, you can.
...will emptying the Tags work or will the references to HPFDJ simply return when I build the executable again?
Yes, it will work. Keep in mind though that every time you modify the report directly from Foxpro and save it, those fields will be updated. (I consider this a shortcoming of Microsoft, but oh well). So before you compile or distribute the reports, be sure to remove that info.
I have made myself a little routine that will do this for me automatically. I'll post the code after this, but if you want, you can even write a little routine to USE the project file, scan through it for report files and then process the following code for each one.
Anyway, here it is. Pass the name of the report file to it like so, leaving off the extension:
DO FixRepo WITH 'MyReport'
*..... FixRepo.PRG .....
STORE rptname + '.frx' TO rptname
REPLACE expr WITH ''
REPLACE TAG WITH ''
REPLACE tag2 WITH ''