Forum > Packages and Libraries
PowerPdf dont save to file
(1/1)
eldonfsr:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFormShipForm.guardar(ShipOrder:string);begin PReport1.FileName:=ShipOrder; PReport1.BeginDoc; PReport1.Print(Pagina); PReport1.BeginDoc;end; calle from this procedureprocedure TFormDelyOrd.BPdfPrintClick(Sender: TObject);begin FormShipForm.PRLCustId.Caption:= InttoStr(FormMain.RxCuDelivery.FieldByName('CustId').AsInteger) ; FormShipForm.PRLCoName.Caption:= FormMain.CiaName; FormShipForm.PRLCUstName.Caption:= FormMain.RxCuDelivery.FieldByName('CoName').AsString ; FormShipForm.PRTCustAddress.Lines.Add( DMSQL.SQLQCust.FieldByName('CustAddress').AsString) ; FormShipForm.DetalleFoma; {Imprimir} FormShipForm.guardar('Shipped/Ship_'+IntToStr(FormMain.RxCuDelivery.FieldByName('DeliveryId').AsINteger)+'.PDF');// FormShipForm.PReport1.FileName:='Ship_'+IntToStr(FormMain.RxCuDelivery.FieldByName('DeliveryId').AsINteger)+'.pdf';// FormShipForm.PReport1.FileName:='Ship_1.pdf';// FormShipForm.PReport1.BeginDoc;// FormShipForm.PReport1.Print(FormShipForm.Pagina);// FormShipForm.PReport1.BeginDoc;// FormShipForm.show;end;
GAN:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---frReport1.ExportTo(TfrTNPDFExportFilter,aArchivo);
eldonfsr:
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:
--- Quote from: eldonfsr 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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFormShipForm.guardar(ShipOrder:string);begin PReport1.FileName:=ShipOrder; PReport1.BeginDoc; PReport1.Print(Pagina); PReport1.BeginDoc; /// <--- HEREend;
--- End quote ---
There is an error, the job should end with a
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---PReport1.EndDoc but you are ending the the job with
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---PReport1.BeginDoc. Once EndDoc is introduced, your code works here.
Navigation
[0] Message Index