Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   QuickReport2.BeforePrint (https://www.clubdelphi.com/foros/showthread.php?t=33838)

chozas 18-07-2006 20:33:46

QuickReport2.BeforePrint
 
Uso QuickReport2 para sacar unos informes los cuales por las características propias de los mismos tardan mucho al visualizarlos. Pero debido a la gran cantidad de código que tengo en el BeforePrint también tardan cuando lo lanzo a la impresora. Esto es porque este evento se lanza tanto al previsualizar como al imprimir. Mi objetivo es que no vuelva a crear el informe cuando lo voy a imprimir, con una variable bandera he podido hacer que al imprimir no ejecute este evento pero he leido que en posteriores versiones a la 2 del QuickReport existe una variable PrintMetafileFromPreview := true ( set the global flag PrintMetafileFromPreview := true;
before the report runs. For instance in the BeforePrint event of the report. This should give identical pagination and be quicker in execution.), entonces me gustaría saber si esta bandera actua de la misma forma ó sería conveniente actuar de otra madera. Las pruebas que he echo aparentemente funcionan pero no estoy muy seguro.

Ejemplo de código:

Código Delphi [-]
implementation

{$R *.DFM}

var
  entra : boolean = false;

procedure TQuickReport2.QuickRepBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);
begin

  if entra then exit; //solo entra en el preview y no al imprimir.
  entra:=true;
  ...

end;


La franja horaria es GMT +2. Ahora son las 18:21:43.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi