AGAG4
29-08-2006, 16:58:04
Uso D6, QReport Prof. 4
Estoy empezando a usar mi aplicación en 1 PC con winxp, todo va bien, pero en ocasiones me reportan que cuando mandan a imprimir un presupuesto que lo tengo creado con QReport, se pone Super Lento a comparación con Win98, tengo 5 PC's trabajando 1 de ellas solo tiene XP y es notorio el cambio, en vez de ir para adelante con un nuevo Sistema Operativo vamos para atras :D, les pongo mis líneas de código al mandar a imprimir:
function PrinterDef(NamePrinter:String):Integer;
var
i:Integer;
begin
result:= -1;
{PrintWin9x:='Presupuestos';
PrintWinNT:='\\Gerencia\Presupuestos';}
if Printer.Printers.Count>0 then begin
for I:=0 to Printer.Printers.Count-1 do begin
ShowMessage(UpperCase(Printer.Printers.Strings[I]));
//Win9x
if (UpperCase(NamePrinter) = UpperCase(Copy(Printer.Printers.Strings[I],1,length(NamePrinter)))) and (NamePrinter<>'') then begin
result:=I;
break;
end;
//WinXP
if Win32Platform = VER_PLATFORM_WIN32_NT then
if (UpperCase(Printer.Printers.Strings[I]) = UpperCase(NamePrinter)) then begin
result:=I;
break;
end;
end;
end else begin
MensajesW('No Hay Ninguna Impresora Instalada.','Error',MB_ICONERROR);
abort;
end;
........
procedure ImprimirPresupuesto;
begin
try
qrRepPresup2.PrinterSettings.PrinterIndex:=PrinterDef(TieneDerechoPC(PCOnLine,Sucursal,'VarPC','LptP re'));
//Preparamos QReport para Determinar No. Total de Páginas
qrRepPresup2.Prepare;
NPages:=qrRepPresup2.QRPrinter.PageCount;
qrRepPresup2.Print;
except
on E:Exception do
MensajesW(PChar(E.Message+',Ha ocurrido un Error al Imprimir Presupuesto, es Probable que la Impresora este Fuera de Línea, Pausada ó Apagada, Si Persiste el Problema Reportelo al Departamento de Sistemas.'),'Error en Impresora',MB_ICONERROR);
end;
Esto Pasa en promedio unas 2 a 4 veces al día, en ocasiones cuando veo que se demora de 3 a 4 mins. para MANDAR a imprimir, mejor cierro la aplicación con CTRL+ALT+SUPR.
Agradezco cualquier sugerencia.
Estoy empezando a usar mi aplicación en 1 PC con winxp, todo va bien, pero en ocasiones me reportan que cuando mandan a imprimir un presupuesto que lo tengo creado con QReport, se pone Super Lento a comparación con Win98, tengo 5 PC's trabajando 1 de ellas solo tiene XP y es notorio el cambio, en vez de ir para adelante con un nuevo Sistema Operativo vamos para atras :D, les pongo mis líneas de código al mandar a imprimir:
function PrinterDef(NamePrinter:String):Integer;
var
i:Integer;
begin
result:= -1;
{PrintWin9x:='Presupuestos';
PrintWinNT:='\\Gerencia\Presupuestos';}
if Printer.Printers.Count>0 then begin
for I:=0 to Printer.Printers.Count-1 do begin
ShowMessage(UpperCase(Printer.Printers.Strings[I]));
//Win9x
if (UpperCase(NamePrinter) = UpperCase(Copy(Printer.Printers.Strings[I],1,length(NamePrinter)))) and (NamePrinter<>'') then begin
result:=I;
break;
end;
//WinXP
if Win32Platform = VER_PLATFORM_WIN32_NT then
if (UpperCase(Printer.Printers.Strings[I]) = UpperCase(NamePrinter)) then begin
result:=I;
break;
end;
end;
end else begin
MensajesW('No Hay Ninguna Impresora Instalada.','Error',MB_ICONERROR);
abort;
end;
........
procedure ImprimirPresupuesto;
begin
try
qrRepPresup2.PrinterSettings.PrinterIndex:=PrinterDef(TieneDerechoPC(PCOnLine,Sucursal,'VarPC','LptP re'));
//Preparamos QReport para Determinar No. Total de Páginas
qrRepPresup2.Prepare;
NPages:=qrRepPresup2.QRPrinter.PageCount;
qrRepPresup2.Print;
except
on E:Exception do
MensajesW(PChar(E.Message+',Ha ocurrido un Error al Imprimir Presupuesto, es Probable que la Impresora este Fuera de Línea, Pausada ó Apagada, Si Persiste el Problema Reportelo al Departamento de Sistemas.'),'Error en Impresora',MB_ICONERROR);
end;
Esto Pasa en promedio unas 2 a 4 veces al día, en ocasiones cuando veo que se demora de 3 a 4 mins. para MANDAR a imprimir, mejor cierro la aplicación con CTRL+ALT+SUPR.
Agradezco cualquier sugerencia.