Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: banffguy on September 08, 2016, 04:28:08 am

Title: (SOLVED)Can't install LasreportpdfExport
Post by: banffguy on September 08, 2016, 04:28:08 am
Lazarus 2.6, FPC 3.0
Have a program using LazReport for generating reports.  Works fine, has for years, would like to be able to generate PDF files, reports. Attempted to install
LasreportPdfExport 0.8 lpk files and  and pack_powerPdf 0.9.9 lpk nothing gets
into the Lazreport component.  Don't know what I'm doing or not doing to cause the failure.  Got the pdfexport lpk from the Lazarus component folder and the powerpdf.lpk from the gz file downloaded from SourceForge.  Can anyone give me some help or step by step directions to get this installation incorporated??
Thanks.
Banffguy
Title: Re: Can't install LasreportpdfExport
Post by: balazsszekely on September 08, 2016, 06:24:09 am
Hi banffguy,

After you install the following packages: LasreportPdfExport0.8 lpk, pack_powerPdf0.9.9 lpk:
   1. Add lazreportpdfexport to the project required packages(Lazarus Menu-->Project-->Project Inspector-->Required Packages(Right Click)->Add-->lazreportpdfexport )
   2. Add lr_e_pdf to the uses clauses
   3. Export a report to pdf
Code: Pascal  [Select][+][-]
  1. if(frReport1.PrepareReport)then
  2.   frReport1.ExportTo(TFrTNPDFExportFilter, 'test.pdf');

regards,
Getmem
Title: Re: Can't install LasreportpdfExport
Post by: banffguy on September 08, 2016, 09:27:31 pm
Thank you for your quick response, am still attempting to get the powerdpf.lrk  installed.  I thought you only had to install the 2 lrk files as normal but I keep getting dependency errors. Will keep working on it.  Maybe I'll hit the right combination sooner or later.
banffguy
Title: Re: Can't install LasreportpdfExport
Post by: balazsszekely on September 08, 2016, 10:41:50 pm
Download the components.zip from here: https://drive.google.com/file/d/0B9Me_c5onmWoWWZyZUdtaWlHSzA/view?usp=sharing
After extraction, copy PowerPDF to your components folder. Compile/Install pack_powerpdf.lpk, then follow the steps from my previous post.
Title: Re: Can't install LasreportpdfExport
Post by: banffguy on September 09, 2016, 05:46:14 am
Back again, got the 2 .lpk files installed, have the Pdfexport icon in the lazprint component and program compiles and runs OK, however when I try to generate the Pdf file I get an error.  Code is;

procedure TForm1.Button3Click(Sender: TObject);
var
  frPdfExportFilter: TfrExportFilterClass;
  begin
      frReport1.LoadFromFile ((DPath) + ('\MemBook.lrf'));
      if(frReport1.PrepareReport)then
      frReport1.ExportTo(FrPDFExportFilter, 'C:\test.pdf');
end;
When it runs I get the error;
------------------------------------------------------------------
Project CarmelDBF raised exception class 'EFCreateError' with message:
Unable to create file "C:\test.pdf"

In file 'lazutf8classes.pas' at line 143:
raise EFCreateError.createfmt({SFCreateError} 'Unable to create file"%S"',[EFilename]}
-------------------------------------------------------------------
Don't have a clue what this is about.
You have been a great help, don't want to wear out my welcome!
Banffguy
Title: Re: Can't install LasreportpdfExport
Post by: balazsszekely on September 09, 2016, 07:01:32 am
Please test attached project.
Title: Re: Can't install LasreportpdfExport
Post by: banffguy on September 09, 2016, 07:14:13 pm

Hey GetMem
Back again!!
Used your attachment and replaced some of my code and it worked lika charm.
Can't thank you enough for all of your patience and help.
My project is for printing a membership booklet for our seniors group, have over
300 mambers to keep track of.  Going to try using the pdf output to print it using the booklet feature.
Guess this one be marked as solved, but don't know how to do that.
Again thaks for all of your help.
Banffman
Title: Re: Can't install LasreportpdfExport
Post by: balazsszekely on September 09, 2016, 08:42:23 pm
Quote
Used your attachment and replaced some of my code and it worked lika charm.
Can't thank you enough for all of your patience and help.
My project is for printing a membership booklet for our seniors group, have over
300 mambers to keep track of.  Going to try using the pdf output to print it using the booklet feature.
You're welcome! I'm glad it's working.

Quote
Guess this one be marked as solved, but don't know how to do that.
Just edit your first post, and change the thread title from:
    "Can't install LasreportpdfExport"
to
   "[Solved]Can't install LasreportpdfExport"
Is optional though, it's up to you.

TinyPortal © 2005-2018