Recent

Author Topic: PowerPdf dont save to file  (Read 3016 times)

eldonfsr

  • Full Member
  • ***
  • Posts: 210
PowerPdf dont save to file
« on: October 01, 2021, 03:19:58 am »
Hi PowerPdf not save to file , I create a report i can see on screen but when trying to save a file don't save nothing i don't know if i some wrong.
Code: Pascal  [Select][+][-]
  1. procedure TFormShipForm.guardar(ShipOrder:string);
  2. begin
  3.   PReport1.FileName:=ShipOrder;
  4.   PReport1.BeginDoc;
  5.   PReport1.Print(Pagina);
  6.   PReport1.BeginDoc;
  7. end;    
  8.  
  9. calle from this procedure
  10. procedure TFormDelyOrd.BPdfPrintClick(Sender: TObject);
  11. begin
  12.   FormShipForm.PRLCustId.Caption:= InttoStr(FormMain.RxCuDelivery.FieldByName('CustId').AsInteger) ;
  13.   FormShipForm.PRLCoName.Caption:= FormMain.CiaName;
  14.   FormShipForm.PRLCUstName.Caption:= FormMain.RxCuDelivery.FieldByName('CoName').AsString ;
  15.   FormShipForm.PRTCustAddress.Lines.Add( DMSQL.SQLQCust.FieldByName('CustAddress').AsString) ;
  16.   FormShipForm.DetalleFoma;
  17.  
  18.   {Imprimir}
  19.   FormShipForm.guardar('Shipped/Ship_'+IntToStr(FormMain.RxCuDelivery.FieldByName('DeliveryId').AsINteger)+'.PDF');
  20. //  FormShipForm.PReport1.FileName:='Ship_'+IntToStr(FormMain.RxCuDelivery.FieldByName('DeliveryId').AsINteger)+'.pdf';
  21. //  FormShipForm.PReport1.FileName:='Ship_1.pdf';
  22. //  FormShipForm.PReport1.BeginDoc;
  23. //  FormShipForm.PReport1.Print(FormShipForm.Pagina);
  24. //  FormShipForm.PReport1.BeginDoc;
  25. //  FormShipForm.show;
  26. end;  
  27.    
  28.  


 

GAN

  • Sr. Member
  • ****
  • Posts: 338
Re: PowerPdf dont save to file
« Reply #1 on: October 01, 2021, 04:12:01 am »
Hello you need to include the lr_e_pdf component in the uses section of your unit, or from the LazReport tabs.
Then you use the ExportTo function:

Hola necesitas incluir el componente lr_e_pdf en la sección uses de tu unidad, o desde las pestaña de LazReport.
Luego usas la función ExportTo:

Code: Pascal  [Select][+][-]
  1. frReport1.ExportTo(TfrTNPDFExportFilter,aArchivo);
  2.  
Lazarus 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

https://searchlazarus.blogspot.com/

eldonfsr

  • Full Member
  • ***
  • Posts: 210
Re: PowerPdf dont save to file
« Reply #2 on: October 01, 2021, 06:27:08 am »
Gracias CAN si deja cambio y creo el reporte y lo exporto..... gracias.

Crei que con pdf seria mas rapido pero no contaba con esto...


jesusr

  • Sr. Member
  • ****
  • Posts: 481
Re: PowerPdf dont save to file
« Reply #3 on: October 29, 2021, 05:30:06 pm »
Hi PowerPdf not save to file , I create a report i can see on screen but when trying to save a file don't save nothing i don't know if i some wrong.
Code: Pascal  [Select][+][-]
  1. procedure TFormShipForm.guardar(ShipOrder:string);
  2. begin
  3.   PReport1.FileName:=ShipOrder;
  4.   PReport1.BeginDoc;
  5.   PReport1.Print(Pagina);
  6.   PReport1.BeginDoc;  /// <--- HERE
  7. end;      
  8.  

There is an error, the job should end with a
Code: Pascal  [Select][+][-]
  1. PReport1.EndDoc
but you are ending the the job with
Code: Pascal  [Select][+][-]
  1. PReport1.BeginDoc
. Once EndDoc is introduced, your code works here.

 

TinyPortal © 2005-2018