Enrico Maria Giordano wrote:Antonio,Antonio Linares wrote:Enrico,
Do you mean that you have replaced:
- Code: Select all Expand view
else
cPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cModel )
SysRefresh()
PrinterInit()
::hDC := GetPrintDefault( GetActiveWindow() )
SysRefresh()
WriteProfString( "windows", "device", cPrinter )
SetPrintDefault( cPrinter ) // NEW !!!
endif
with:
- Code: Select all Expand view
else
::hDC = PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
endif
thanks
Yes, my friend.
EMG
METHOD New( cDocument, lUser, lPreview, cModel, lModal, lSelection, cFile ) CLASS TPrinter
local aOffset
local cPrinter
DEFAULT cDocument := "FiveWin Report" ,;
lUser := .f., lPreview := .f., lModal := .f., lSelection := .f.
if lUser
::hDC := GetPrintDC( GetActiveWindow(), lSelection, PrnGetPagNums() )
if ::hDC != 0
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
endif
elseif cModel == nil
::hDC := GetPrintDefault( GetActiveWindow() )
if ::hDC != 0
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
endif
else
::hDC = PrinterDcFromName( , cModel, )
endif
else
msginfo( cModel )
::hDC = PrinterDcFromName( , cModel, )
endif
else
msginfo( cModel )
::hDC = PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
endif
Static Function oaPrinterSetup() // Sem essa função, o FWH respeita a seleção apenas para o próximo relatório, voltando depois para o padrão do Windows.
GetPrintDC( GetActiveWindow() ) // Abre a tela para a seleção da impressora
cModel := PrnGetName() // Grava a última impressora selecionada pelo usuário
Return nil
ORibeiro wrote:Unfortunately, neither of the two alternatives work.
The "MsgInfo(CModel)" shows the printer selected by the user but prints to another printer that is default in Windows.
ORibeiro wrote:Mu Fwh is the last one.
Fwh13.09 rev2 don't have this fix?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 64 guests