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!

Printing Problem: "Printer Not Ready"...it realy is??

Status
Not open for further replies.

alan232

Programmer
Joined
May 19, 2004
Messages
144
Location
US
Hi! Can someone help me?
I captured text output to a local disk file. When I supply the following PrintFile() with a printer port, chosen by the user in a drop-down combo box populated by 'aprinters()', it works fine as long as the printerPort is on a networked machine. But the same methodology fails when I'm actually on the machine doing the printing. To clarify, I have a presario computer etherneted to a second machine, 'stevenson', which itself is ethernetted to a hewlet packard print hub that connects directly to a lexmark printer. When the presario selects "\\stevenson\lexmark" as a printer port, printing occurs without a hitch. However, when I'm on the 'stevenson' machine, simply using "lexmark" as the printerport always results in "Printer not Ready", even though I can print test pages (via the windows printer panel) all day without a hitch. I'm using visual foxpro 6. The stevenson machine uses Windows XP, and the Presario uses Window ME. Here is the code:

procedure PrintFile
lparameters lcTextFile, lcPrinterPort
if empty(m.lcPrinterPort)
return
endif

set console off
set headings off
set printer to &lcPrinterPort
type (m.lcTextFile) to printer
set printer to
set headings on
set console on
return

Anyhelp would realy be appreciated...I don't understand the pring commands at all.
Sincerely,
Alan J Wayne
p.s. I tried the 'set printer to name 'printer'' with the same result...This is quite fustrating.
 
alan232

I've encountered a similar situation this week. Small network (2 computers - one XP, one ME), where ME couldn't not print but XP could. The solution I tried was to "reduce the printer drivers to a common denominator" where ME->XP was not compatible and XP->ME was. So I installed the printer based on an ME printer driver on both machines, and the situation got resolved.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks!

I will try (I have no idea where to go a current driver for an old operating system...but will try).

Sincrely,
Alan J Wayne.
p.s., Sorry for the mispelled 'realy'---> 'really'
 
Hi All,

Solved my problem--I Think.

In this code:
set printer to &lcPrinterPort
works as long as the printer port is of type '\\...\...', but only created a file otherwise.

I believe the basic problem was that I used aprinters() to populate a drop-down combo box and that something was happening to the windows friendly printer name (in column 1 of aprinters()) before
set printer to name (column1_printer_name)

When I processed aprinters() output by placing a space(1) before the column1 and coloumn2 entries, then populated the drop-down combo box with the new array, all worked fine.
(I remove any leading spaces from the name prior to set printer...)

Thanks again,
Alan
(p.s., the above code now works under networked and non-networked machines, using windows ME, windows 98, windows 2000 professional, and windows xp)



 
Hi Alan,

set printer to &lcPrinterPort

If there are spaces in the path the path will be truncated at the first space. Use (lcPrinterPort) or "&lcPrinterPort."

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top