Tema: PowerPDF
Ver Mensaje Individual
  #2  
Antiguo 02-09-2003
Viet Viet is offline
Miembro
 
Registrado: jul 2003
Ubicación: Argentina - Mar del Plata
Posts: 252
Reputación: 21
Viet Va por buen camino
la solucion seria algo asi:

with pdf do
begin
FileName := nomArch;

// starting printing document.
BeginDoc;

sp.ParamByName('@id_cuenta').AsInteger := idCuenta;
sp.ParamByName('@desde').AsDate := desde;
sp.ParamByName('@hasta').AsDate := hasta;
sp.Open;

cantpag := sp.RecordCount div PRGridPanel1.RowCount;
if (sp.RecordCount mod PRGridPanel1.RowCount)>0 then
inc(cantpag);

pag := 1;
while not sp.Eof do
Print(PRPage1);

// save document.
EndDoc;
sp.Close;
end;
finally
Screen.Cursor := crDefault;
end;

procedure TfmStatement.PRGridPanel1AfterPrint(Sender: TObject;
ACanvas: TPRCanvas; Rect: TRect);
begin
inc(pag);
end;

procedure TfmStatement.PRLayoutPanel1BeforePrint(Sender: TObject;
ACanvas: TPRCanvas; Rect: TRect);
begin
laPag.Caption := 'Page '+IntToStr(pag)+' of '+IntToStr(cantpag);
end;
__________________
Marín Ignacio Borthiry (Viet) - "El hombre arriesga su vida cada vez que elije y eso es lo que lo hace libre" ;)
Responder Con Cita