Fórum Selecionar a impressora q desejo imprimir no rave report #272824
17/03/2005
0
Goataria de saber como faço para selecionar a impressora q desejo imprimir no rave report, é q relatórios normais quero usar uma jato de tinta só q a nota fiscal quero q saia numa matricial, alguém tem uma dica?
Obrigado!!!
Rogério Martins
Rogsystem
Curtir tópico
+ 0Posts
17/03/2005
Fred
ou vc quer que o usuario nao precise escolher!! pq o rave usa a que esta padrao no windows!!
Esclarece ae!
Gostei + 0
17/03/2005
Rogsystem
Gostei + 0
17/03/2005
Rômulo Barros
procedure SetDefaultPrinter; var Device : array[0..cchDeviceName] of char; Driver : array[0..MAX_PATH] of char; DriverPort : string; Port : array[0..MAX_PATH] of char; hDMode : THandle; s : array[0..64] of char; WinIni : TIniFile; WinIniFileName : array[0..MAX_PATH] of char; begin if PrinterSetupDialog.Execute then begin Printer.GetPrinter(@Device, @Driver, @Port, hDMode); // For some reason "Driver" is never defined here by GetPrinter. // Let´s get "Driver,Port" from the Win.INI file "Devices" section GetWindowsDirectory(WinIniFileName, SizeOf(WinIniFileName)); StrCat(WinIniFileName, ´\win.ini´); WinIni := TIniFile.Create(WinIniFileName); try // Lookup Driver,Port in INI file "Devices" section DriverPort := WinIni.ReadString(´devices´, Device, ´´); // Update INI "Windows" section -- this is the Windows defaultprinter WinIni.WriteString(´windows´, ´device´, Device + ´,´ + DriverPort) finally WinIni.Free end; // Flush INI cache WritePrivateProfileString(NIL, NIL, NIL, WinIniFileName); // Broadcast system wide message about win.ini change s := ´windows´; SendMessage(HWND_BROADCAST, WM_WININICHANGE,0, Cardinal(@s)); end; end;
_____________________________________________
[b:c172149c72][color=blue:c172149c72]Utilize a Ferramenta de Pesquisa do Fórum[/color:c172149c72][/b:c172149c72]
Pesquisar pelos termos
_____________________________________________
[b:c172149c72]Veja como[url=http://forum.clubedelphi.net/viewtopic.php?t=16976] OBTER RESPOSTAR RÁPIDAS[/url][/b:c172149c72]
[b:c172149c72]Veja as novas [url=http://forum.clubedelphi.net/viewtopic.php?t=59817]MUDANÇAS NA ESTRUTURA[/url] do site[/b:c172149c72]
[b:c172149c72]Leia sempre as [url=http://forum.clubedelphi.net/viewtopic.php?t=6689]REGRAS DE CONDUTA[/url][/b:c172149c72]
Gostei + 0
17/03/2005
Fred
Gostei + 0
18/03/2005
Rogsystem
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)