PAGUE 6 MESES
LEVE 12 MESES
GARANTIR DESCONTO

Fórum printer setup no quick report #558684

28/06/2016

0

Olá bom dia, gostaria de saber como usar o printer setup no quickreport para escolher impressora e número de copias...
quando executo preview e clico direto no botão imprimir ok mas quando clico em printer setup me mostra o seguinte erro "List index out of bouders (-1)"
Se alguém puder me ajudar agradeço muito.
Francisco Júnior

Francisco Júnior

Responder

Posts

29/06/2016

Francisco Júnior

Resolvi o problema fazendo uma modificação no arquivo vcl.printers.pas do Delphi XE6 e compilando o arquivo vcl.printers.dcu para dentro da pasta lib/debug

procedure TPrinter.SetPrinterIndex(Value: Integer); var lDevice, lDriver, lPort : Array[0..255] of Char; lDeviceMode : THandle; begin CheckPrinting(False); if (Value < -1) or (Value >= Printers.Count) then RaiseError(SPrinterIndexError); if (Value = -1) or (PrinterIndex = -1) then //****************** condition from XE5 vcl.printers SetToDefaultPrinter; if Value <> FPrinterIndex then begin if Value <> -1 then //****************** condition from XE5 vcl.printers FPrinterIndex := Value; with TPrinterDevice(Printers.Objects[FPrinterIndex]) do {$IF DEFINED (CLR)} SetPrinter(Device, Driver, Port, 0); {$ELSE} Printer.GetPrinter(lDevice, lDriver, lPort, lDeviceMode); GlobalUnlock(lDeviceMode); GlobalFree(lDeviceMode); lDeviceMode := 0; Printer.SetPrinter(lDevice, lDriver, lPort, lDeviceMode); {$ENDIF} FreeFonts; SetState(TPrinterState.psNoHandle); end; end;
Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar