Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REPORT FORM tries to save to TIF file.

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I have an application which prints text files using the VFP REPORT FORM command.

So I take the text file, decide how wide the lines are and turn it into a rather simple table, which mainly has one field in each record and say something like :

REPORT FORM ANMP08 TO PRINTER NOCONSOLE

. . . where ANMP08.FRX prints the lines in Courier 8 point, portrait. It is fairly crude. And as far as I know it will print to the user's "Current printer" even though when I defined the report, it would have been using a printer on my system.

However I note that when I was running some reports, VFP runtime kept asking where I wanted to save a TIF file. This foxed me for some time until I realised that the printer associated with that report definition was "Microsoft Document Image Writer". Is there some reason why in such cases the user's default printer is not used? Or does it only search for the user's default printer if it cannot find, on the user's system, the printer that I was using when I created the report?
 
Have you 'hacked' the Report Form to remove any 'inherited' printer information?

Code:
USE MyReport.frx
SELECT MyReport
REPLACE Expr WITH "", TAG WITH "", TAG2 WITH "" FOR RECNO() = 1

Or if you are using VFP9 have you check for it to not save the environment?

If your Report Form does not have any printer environment parameters which would cause it to behave otherwise, then it will use the VFP Printer which is typically (unless otherwise specified) the Windows default printer.

Additionally, as you have talked about above already, is the default Windows printer in the workstations in question defined to be something other than "Microsoft Document Image Writer"?

Good Luck,
JRB-Bldr
 
Andrew,

I replied to your question yesterday, but I see my reply has been removed. I hope it didn't include anything that might have been offensive. I certainly didn't mean it to.

My reply was similar to JRB-Bldr's. The first thing to do in these cases is always to ensure you haven't saved the printer environment.

You should also specify the printer for the report explicitly, either by adding a PROMPT clause to the REPORT FORM command, or via SET PRINTER.

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thank you both. and sorry for the delay in my acknowledgement. I have removed the default printer (by hacking the frx file) and in this case the report defaults to the user's default printer and all is well.

On his own installation (if he wishes) he may MODIFY REPORT to set a specific printer for the report.
 
You don't want to "MODIFY REPORT to set a specific printer for the report."
That would set that report to the single output device forever until the Report Form was 'hacked'.

Instead you want to either issue a
REPORT FORM MyReport PROMPT NOCONSOLE TO PRINTER
which will throw up a selection screen where the user can select the desired output printer.

Or you want to issue a
=SYS(1037)
just prior to the REPORT FORM command - which will bring up an interactive printer selection window.

Good Luck,
JRB-Bldr


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top