There is no default printer currently selected...
Olá, estou tentando criar um relatório quick report e coloquei uma impressora padrão lá na pasta ´improssoras´ para ter uma impressora padrão (mas a impressora não existe fisicamente no computador), mas quando tento criar o relatório ´QuickReport1 := TQuickReport1.Create(Self);´ dá o seguinte erro: ´There is no default printer currently selected´.
alguém tem alguma dica?
abraços,
Gilson.
alguém tem alguma dica?
abraços,
Gilson.
Gilsonmv
Curtidas 0
Respostas
Eixox
14/01/2005
Já tive o mesmo tipo de problema e estava relacionado ao sistema operacional em uso - no caso o 2003 e o XP. Na verdade se não me engano a instalação de impressoras num desses sistemas pode ocorrer, mas quando você chama determinadas aplicações elas respondem que não há uma impressora instalada. Isso porque o sistema operacional não detecta a impressora (elemento físico através do cabo de comunicação).
Porque você não instala uma impressora no seu computador e faz o teste?
Porque você não instala uma impressora no seu computador e faz o teste?
GOSTEI 0
Massuda
14/01/2005
No site da QUSoft existe a seguinte informação (veja o original [url=http://www.qusoft.com/Printerbug.html]nesta página[/url]):
Note que esse é um bug da VCL e não do Quick Report.
O arquivo Printers.pas citado está na pasta Source\VCL do diretório onde o Delphi está instalado (se sua versão de Delphi tem direito ao código fonte da VCL).
Printers.Pas bug: ´There is no default printer currently selected´
http://buglist.jrsoftware.org/generated/entry0616.htm
Reported by Eivind Bakkestuen
Even if the machine in question does have a default network printer
selected, this message would crop up and the user would have to select
a local printer manually within our program to be able to print.
Reproducing it: it´s probably related to using login script functionality
to get the list of printers from the server upon workstation startup.
It is a bug, since the machine most definitely does have a default
printer selected (that it is a network printer shouldn´t matter).
Cause:
The TPrinter.SetToDefaultPrinter routine in Printers.Pas makes an
assumption that all printer names returned from win32 api functions
will always be capitalized exactly the same. It is this line inside
the loop that determines the default printer (line 867 in D5´s printers.pas)
that´s the cause of the problem:
if TPrinterDevice(Objects[I]).Device = Device then
After perusing a log file from the client, generated by a log-enabled version
of this routine, it turned out that Device was something like
´HP Printer something´ while the devicelist contained ´HP PRINTER SOMETHING´,
leading the comparison to fail.
Workaround / Fix
The workaround is simple enough: I stuck an AnsiUpperCase() call
on each side of the equals sign, and then the default printer
was recognized as such.
Note que esse é um bug da VCL e não do Quick Report.
O arquivo Printers.pas citado está na pasta Source\VCL do diretório onde o Delphi está instalado (se sua versão de Delphi tem direito ao código fonte da VCL).
GOSTEI 0