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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report not printing from within program

Status
Not open for further replies.

mroth36

Programmer
Jul 21, 2005
27
0
0
I am doing a 'repo form to print' from within a program FP Version 9. At Workstation A it seems to go nowhere, while at Workstation B it prints ok. Workstation A has a default printer & other software successfuly print to it. In addition this Foxpro report DOES PRINT if I issue the 'repo form to print' from the command box. Any Clue?

Thank You
 
Does your report have a Printer Driver associated with it? And if so, is it that printer that is connected? I have had unusual behavior in previous versions of Fox when the first two records of the .FRX have printer driver data saved in them. Open the report form as a data table, and delete the data from the Memo fields that is realted to Default Printer Drivers...

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Mroth,

Just to get this right ....

On Workstation A, the report prints OK if you issue the command from the command window, but not from within a program?

If that's so, it's most likely because the program has a different default printer setting. Chances are it is printing to a printer in another room, or to a print file, or to a PDF file, or soemthing similar.

Add the following immediately before you call the report:

MESSAGEBOX(SET("PRINTER",3))

That should tell you where the report is really going.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
mroth,

I was just having the problem that I couldn't change printer I was printing to.

It seems a 'printer environment' is saved to each frx by default. Then when you print that report, no matter what you SET PRINTER TO, that report will only print to that printer. This is what Scott was refering to backending.

If you open the frx not as a table, but as a regular report, then go to File -> Page Setup, at the bottom of the pop-up form uncheck 'Save Printer Environment'. Now when you issue

SET PRINTER TO NAME myprintername
SET PRINTER ON
REPORT FORM myformname TO PRINTER

it will actually print to the printer you expect.

Of course, this printer must be installed on the computer you're running the program on. That might be your problem too.
 

Although I agree with Scott and KevArnold, I don't see how that can explain the issue in this case.

If the printer is wrong in the printer environment, surely the report would fail at the command window as well?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
mroth,

Are you issuing 'repo form to print' from the command box from Workstation A or Workstation B?
 
HI Everyone,

Scott, you are RIGHT. I edited the FRX file and found the default printer of Workstation B (from where it was printing ok) was 'hard coded' in some memo fields. When I checked THAT printer, it was there. I deleted all the data from all the memo fields that mentioned that printer & it prints from Workstation A fine (to Workstation A's default printer)!
Mike, I tried the 'messagbox' command at Workstation A, prior to the above-mentioned change and: messagebox returned the default printer of Workstation A, while the report actually printed at the 'hard coded' printer.
Kevanarnold, the repo form from the command line was working fine on both workstations.
Everyone, thanks alot you are all great!
 
Mroth,
Excellent! Have been bitten by this one before...



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Just curious,

I haven't used VFP 9 much for reports, but it's my understanding that there is a checkbox to "save printer environment" (that is off by default) which was added to the report form setup to prevent this very problem. Was that option checked? If so you may want to uncheck it so the printer info doesn't get saved in the frx again the next time someone modifies the report form.

Mike Reigler
Melange Computer Services, Inc
 
Mike,
I checked that out. From previous experience, when I was converting versions (recently from FP Version 3 to VFP Version 6) I was running into report problems. I deleted all the tables from 'environment' section and it resolved the problem. Likewise in this situation, the 'environment'
section has no tables.

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top