>We have very starnge situation
>We have printer form which works for meny years in many our projects ( exe).
>It permits to select printer , copies numbers, pages, to send report to the printer or screen, modify report etc
>Two weeks ago one of our clients said , he can not to choose printer any more
>He selects printer ( not default), click print and reports goes to the default printer on the net.
>We deleted info about the printer from frx ( first record) and in this case program shows like it print reports ( small window with frx proccesing) and no printing anywhere.
>The comand for printing is regular
>set printer to name selectedprinter
>report form ... noconsole to printer
>To eliminate some unknown bugs in the form I came to client myself, temporaly installed VFP , used command window and tried to send report to selected printer by
>set printer to getprinter()
>report form ... noconsole to printer
>And... same situation
>I checked set('printer',3) and it has shown the right selected printer , not default one
>The reports goes to default printer or to nowhere
>All printers are at net computers, but just if printer is on your own computer
>it is same situation
>The only one thin was changed in this company, server computer has windows XP instead of 98.
>I deinstalled VFP there and don't know , what to do now.
>This form works ok for us, and for the rest of our clients.
>Where could be the reason of this behaviour?
>Thanks in advance , Vladimir
Vladimir,
I believe you are experiencing what I have described in message#
789331.
Since you have a printer form, you have only one place to change anything ( I have the 'REPORT FORM ..PROMPT' scattered all over the app)
Can you try the following (this will reset the default windows printer temporarily)
Instead of
set printer to name (SomePrinterName)
use
local sPrint, NewPrinter
NewPrinter = GetPrinter()
=Printer_Set(NewPrinter, @sPrint)
=_fpReset()
report form (NameOfYourReport) NOCONSOLE To Printer
=_fpReset()
=Printer_Set(sPrint)
function Printer_Get()
return WindowsPrinter_Get()
endfunc
function Printer_Set(PrinterNew, PrinterOld)
=WindowsPrinter_Set(PrinterNew, @PrinterOld)
endfunc
function WindowsPrinter_Get()
return set('Printer', 2)
endfunc
function WindowsPrinter_Set(PrinterNew, PrinterOld)
local wsh, sError
sError = on('error')
PrinterOld = WindowsPrinter_Get()
do case
case lower(PrinterOld) <> lower(PrinterNew)
wsh = CreateObject('WScript.Network')
private HadError
HadError = FALSE
on error HadError = TRUE
wsh.SetDefaultPrinter(PrinterNew)
on error &sError
wsh = Null
return !HadError
endcase
endfunc
Success,
Gregory