FWH 13:09 Default Printer
FWH 13:09 Default Printer
Linares,
I'm having a lot of complaints from my clients because in the version I was using the FWH the user selected a printer and it kept while he was inside the system, but now the printer selected is valid just for the next printing. Is necessary to select again each print.
Is there anything I can do to make the FWH back to work as before?
I'm having a lot of complaints from my clients because in the version I was using the FWH the user selected a printer and it kept while he was inside the system, but now the printer selected is valid just for the next printing. Is necessary to select again each print.
Is there anything I can do to make the FWH back to work as before?
Last edited by ORibeiro on Wed Nov 13, 2013 11:46 am, edited 1 time in total.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
-
- Posts: 117
- Joined: Tue Jan 03, 2006 6:18 pm
Re: FWH 13:08 Default Printer
HI ORibeiro,
Yes, I confirm this problem.
So I change my code like this :
coldprinter := prnGetName() // default printer
WriteProfString( "windows", "device",cnewprinter) // change to new printer
SetPrintDefault(cnewprinter)
PrinterInit()
SysRefresh()
....
.....
// change to default printer
WriteProfString( "windows", "device",coldprinter) // default printer
SetPrintDefault(coldprinter)
PrinterInit()
SysRefresh()
regards,
Kok
Yes, I confirm this problem.
So I change my code like this :
coldprinter := prnGetName() // default printer
WriteProfString( "windows", "device",cnewprinter) // change to new printer
SetPrintDefault(cnewprinter)
PrinterInit()
SysRefresh()
....
.....
// change to default printer
WriteProfString( "windows", "device",coldprinter) // default printer
SetPrintDefault(coldprinter)
PrinterInit()
SysRefresh()
regards,
Kok
Re: FWH 13:08 Default Printer
Kok,
Thanks for your reply.
The problem with SetDefaultPrinter() function "for my use" is that my clients use my programs within Windows Server and Terminal Server with the same user, for example, the user "SALES" is used by 10 vendors and in this case, when a change the default printer in Windows, switches to all others.
I need to let the default printer only within the program (such as FWH worked before) and not on Windows printers.
If I find out what the command line of the new FiveWin that returns to the system's default printer windows when closing the report I disable this line and problem solved!
Does anyone know what is that line?
Thanks for your reply.
The problem with SetDefaultPrinter() function "for my use" is that my clients use my programs within Windows Server and Terminal Server with the same user, for example, the user "SALES" is used by 10 vendors and in this case, when a change the default printer in Windows, switches to all others.
I need to let the default printer only within the program (such as FWH worked before) and not on Windows printers.
If I find out what the command line of the new FiveWin that returns to the system's default printer windows when closing the report I disable this line and problem solved!
Does anyone know what is that line?
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FWH 13:08 Default Printer
_,
> Does anyone know what is that line?
What line do you mean ? Please copy it here, thanks
> Does anyone know what is that line?
What line do you mean ? Please copy it here, thanks
Re: FWH 13:08 Default Printer
Linares,
Thank you for your interest in helping me.
I need to know when the Fivewin causes the printer system is equal to the windows after the printing. It is this function (lines) that I need to cancel in my system, so that the printer selected by the user to keep active while the system is open.
Thank you for your interest in helping me.
I need to know when the Fivewin causes the printer system is equal to the windows after the printing. It is this function (lines) that I need to cancel in my system, so that the printer selected by the user to keep active while the system is open.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FWH 13:08 Default Printer
Please try to use the proposed change by Kok, thanks:
Code: Select all
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
cPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cModel )
SysRefresh()
PrinterInit()
::hDC := GetPrintDefault( GetActiveWindow() )
SysRefresh()
WriteProfString( "windows", "device", cPrinter )
SetPrintDefault( cPrinter ) // NEW !!!
endif
...
Re: FWH 13:08 Default Printer
Linares,
I did it.
However, I use Windows Server with Terminal Server with the same user TS is connected simultaneously by multiple people. By using command "SetPrintDefault( cPrinter )" the person changes the default printer in windows for all others who are using the same user.
So I can not use the "SetPrintDefault( cPrinter )".
I need to keep the selected printer only within the program open, without changing the Windows default printer.
I did it.
However, I use Windows Server with Terminal Server with the same user TS is connected simultaneously by multiple people. By using command "SetPrintDefault( cPrinter )" the person changes the default printer in windows for all others who are using the same user.
So I can not use the "SetPrintDefault( cPrinter )".
I need to keep the selected printer only within the program open, without changing the Windows default printer.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: FWH 13:08 Default Printer
_,
this is what I'm using:
EMG
this is what I'm using:
Code: Select all
else
::hDC = PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
endif
...
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FWH 13:08 Default Printer
Enrico,
Do you mean that you have replaced:
with:
thanks
Do you mean that you have replaced:
Code: Select all
else
cPrinter := GetProfString( "windows", "device" , "" )
WriteProfString( "windows", "device", cModel )
SysRefresh()
PrinterInit()
::hDC := GetPrintDefault( GetActiveWindow() )
SysRefresh()
WriteProfString( "windows", "device", cPrinter )
SetPrintDefault( cPrinter ) // NEW !!!
endif
Code: Select all
else
::hDC = PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
endif
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: FWH 13:08 Default Printer
Antonio,
EMG
Yes, my friend.Antonio Linares wrote:Enrico,
Do you mean that you have replaced:with:Code: Select all
else cPrinter := GetProfString( "windows", "device" , "" ) WriteProfString( "windows", "device", cModel ) SysRefresh() PrinterInit() ::hDC := GetPrintDefault( GetActiveWindow() ) SysRefresh() WriteProfString( "windows", "device", cPrinter ) SetPrintDefault( cPrinter ) // NEW !!! endif
thanksCode: Select all
else ::hDC = PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) ) endif
EMG
Re: FWH 13:08 Default Printer
Eurico / Linares,
My program is processing this elseif...
So I changed this:
The result was that he keeps the printer selected, as I will, but no longer opens a preview of the report.
We're almost there! Any ideas?
My program is processing this elseif...
Code: Select all
elseif cModel == nil
::hDC := GetPrintDefault( GetActiveWindow() )
if ::hDC != 0
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
endif
Code: Select all
elseif cModel == nil
// ::hDC := GetPrintDefault( GetActiveWindow() )
::hDC := PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
if ::hDC != 0
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
endif
We're almost there! Any ideas?
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FWH 13:08 Default Printer
_,
Try it this way:
Try it this way:
Code: Select all
elseif cModel == nil
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
::hDC := PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
Re: FWH 13:08 Default Printer
Linares,
I tried, but always returns zero in ::hdc and not print.
Another idea?
I tried, but always returns zero in ::hdc and not print.
Another idea?
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FWH 13:08 Default Printer
_,
Please check whats the value for cModel:
...
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
MsgInfo( cModel )
...
Please check whats the value for cModel:
...
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
MsgInfo( cModel )
...
Re: FWH 13:08 Default Printer
With PDF Printer:
PDF reDirect v2,winspool,PDF_REDIRECT_PORT:
With SAMSUNG Printer:
\\OASYS4\Samsung SCX-4200 Series,winspool,USB001
Thanks.
PDF reDirect v2,winspool,PDF_REDIRECT_PORT:
With SAMSUNG Printer:
\\OASYS4\Samsung SCX-4200 Series,winspool,USB001
Thanks.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72