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

set printer to command - not working 1

Status
Not open for further replies.

CMcC

Programmer
Feb 5, 2002
196
US
Hi- using VFP 7.0
I can call a report by
report form myreport.frx to printer [red]prompt[\red] noconsole
and it works fine.

However, when I print reports in mass - I dont want to prompt the user each time the report is called, so I issue this command:

set printer to name LetterHead before the report form call.

NOTHING PRINTS! It doesnt even get spooled to the printer.

What would be the difference between the PROMPT and the
set printer to name LetterHead command?

BTW- this is a jet directed network printer.
I also have the LetterHead printer in the page setup of the report, that way when they are prompted, they can just select Enter to print the report- (we have several printers on our windows machines).


I thought that having the printer in the page setup would
help with the mass printing problems...but nope.

Oh-
i have also tried to issue the 'set printer to'
at the end of my do while !eof() loop - to force the print to start, but no luck there.



Any suggestions?
 
i tried setting the printer name manually with constant frustration.. so i just started using getprinter() to grab the printer name.

i add a property to my global app class object to keep track of the last selected printer.. then i include this in the print button's click event..

Code:
IF EMPTY(oapp.cprinter)
	oapp.cprinter = GETPRINTER()
	IF !EMPTY(oapp.cprinter)
		SET PRINTER TO NAME (oapp.cprinter)
	ENDIF
ENDIF

and of course, i include an option to change the printer as well.

jus a suggestion..
 
Hi ThatGuy-
tried the getprinter() fuction as well, with no luck...

set printer to name getprinter()

it's strange, though, because the window that lets you know that it's printing comes up - but it never gets to the spooler.
I will give your routine a try and let you know!
Thanks
cmcc
 
CMcC,

Try :

SET PRINTER ON
SET PRINTER TO NAME \\ServerName\PrinterName

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Hi eguy-
no luck there either.
Dont know why this is happening. Prints fine when I prompt - but not when I assign by getprinter() or set printer to name LetterHead.

This is drving me crazy.
So - everytime that this runs, I call the report and update the file that the report was printed....although the report did not print.

Is there someway that I can set a logical value to see if the report actually did print? And if it did not, do not update the file?
Everytime they run the program and it doesnt print, I have to change all the printed = .t. fields to printed to .f. so that they can print again.

This is very frustrating.

 
CMcC,

Is there someway that I can set a logical value to see if the report actually did print? And if it did not, do not update the file?

If PRINTSTATUS( ) returns .T. you can assume (damn I hate that word) it should have printed somewhere.

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
thanks Eguy-

ThatGuy-
Tried your solution and Im getting it to the spooler - although it prints blank pages.

Will try more.
thanks
cmcc
 
Do you mean that no data is coming thru - just blank pages? Or you're getting what you want Plus blank pages?

If the latter, check your margins. I've created/tested reports on one printer, then printed the report on another printer, but the margins (printable areas) were different between the printers. What ended up was about a quarter inch (of nothing) hanging over, so the printer put that blank area on a second page.

If the problem is the former - no data/labels/lines/output whatsoever, well, thas a little more complicated...

-- frank~
 
Hi frank-
no data is coming thru - just blank pages....


I think that I may have figured out whats going on - but not 100% sure -
I have went behind the report to the table by:

use myreport.frx
browse

Took out everything in the EXPR field and Tag1,Tag2 fields.
I disassociated the printer form the report. So will let you know how that goes.
Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top