Recent

Author Topic: [SOLVED] Lazreport PDF  (Read 553 times)

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
[SOLVED] Lazreport PDF
« on: January 14, 2026, 08:58:20 am »
Morning All

In Lazreport I have the component installed where the user can save the preview report to PDF.
I want to Save it to pdf without the preview, and attach it to a new email.

The attachment and open email part I can do, but there are a number on solutions on the web, many with different components that all failed so far.
Can one not simply have something like Frreport1.savetofile('Report1.PDF')?

There are numerous examples of some export function i cannot get to work yet.  :D

Your help is always much appreciated.

-Peter
« Last Edit: January 15, 2026, 07:42:20 am by Petrus Vorster »

mig-31

  • Sr. Member
  • ****
  • Posts: 308
Re: Lazreport PDF
« Reply #1 on: January 14, 2026, 11:54:11 am »
lrPDFExport should be installed.
You should call PrepareReport first and then export it to pdf
Code: Pascal  [Select][+][-]
  1.  
  2. PdfFileName := FileName + '.pdf';
  3. if Report.PrepareReport then
  4.    Report.ExportTo(TlrPdfExportFilter, PdfFileName);  
  5.  
     
Lazarus 4.0 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: Lazreport PDF
« Reply #2 on: January 15, 2026, 06:43:59 am »
Hi

Thank you for the response.
I have it like that, but I continue to get an error 'Identifier not found TlrPdfExportFilter'

I have the component in a datamodule, but moving it to the form doesnt help,
Its probably just a name thing or womewhere I needed to make a reference I missed.

-Peter

paweld

  • Hero Member
  • *****
  • Posts: 1568
Re: Lazreport PDF
« Reply #3 on: January 15, 2026, 07:09:49 am »
You must add lr_e_fclpdf unit to uses section
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: Lazreport PDF
« Reply #4 on: January 15, 2026, 07:27:07 am »
I knew I went wrong somewhere.

Ok, now there are no errors.
However, the report clearly runs, but there is no file written to the drive.

If I run a report preview, that works perfect.
The Export function gives no errors, but also writes nothing.

That too has to be something small again I missed.

Thank you for your patience.

-Peter

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: [SOLVED] Lazreport PDF
« Reply #5 on: January 15, 2026, 07:42:59 am »
I found a method that works.

Thank you all.
-Peter

 

TinyPortal © 2005-2018