Lazarus

Programming => Databases => Topic started by: dodgebros on January 07, 2021, 07:24:36 pm

Title: How do I install/use FPReport?
Post by: dodgebros on January 07, 2021, 07:24:36 pm
I have Lazarus IDE version 1.8.0 and FPC 3.0.4 installed on Win7, 32bit OS.  I would like to use FPReports,  including the GUI Designer.  How do I install FPReports?

TD  :o
Title: Re: How do I install/use FPReport?
Post by: trev on January 07, 2021, 10:15:51 pm
There is comprehensive documentation in the Wiki: FPReport (https://wiki.freepascal.org).
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 08, 2021, 12:03:47 am
Ok, I have read the Wiki docs on FPReport and I did not see how to install FPReport.  So, how do you install FPReport as part of Lazarus?

TD  8)
Title: Re: How do I install/use FPReport?
Post by: trev on January 08, 2021, 12:56:05 am
FPReport FAQ (https://wiki.freepascal.org/FPReport_FAQ) seems to be the relevant article.
Title: Re: How do I install/use FPReport?
Post by: Handoko on January 08, 2021, 03:42:17 am
FPReport can be found at:
Lazarus main menu > Package > Install/Uninstal Packages > on the right panel searchbox type: fpreport

Unfortunately, just like the FAQ said it cannot compile on 64-bit Lazarus. It failed on my Lazarus 2.0.10 64-bit Linux with this message:
Quote
Compile package cairocanvas_pkg 0.0: Aborted
Compile package lclextensions_package 0.6.1: Exit code 1, Errors: 1
delphicompat.pas(137,2) Fatal: Cannot open include file "uses.inc"

Note:
You should not try it on your production computer. If fpreport fails to install when rebuilding the IDE, the package system will become messy. Now I cannot rebuild my Lazarus even I remove the package, will have to spend some time manually cleaning it or reinstall the Lazarus.
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 08, 2021, 05:09:44 am
Hi Handoko, thanks for helping.  I looked at Lazarus main menu > Package > Install/Uninstal Packages > on the right panel  but fpreport is not listed there.  I have already read the FAQ but I'll take another look, maybe I missed something.

TD 8)
Title: Re: How do I install/use FPReport?
Post by: Handoko on January 08, 2021, 05:38:38 am
As far as I know FPReport is not available on Lazarus 1.8.0. You should to consider to upgrade your Lazarus.
Title: Re: How do I install/use FPReport?
Post by: af0815 on January 08, 2021, 11:39:03 am
FPReport need FPC3.2.x as a minimum (for working out of the box, without coping files around). FPReport resides in the fpc, Lazarus have only a wrapper and some additional components. So only install a fresh Lazarus with an old fpc will also not work.
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 08, 2021, 06:56:43 pm
Ah, that is why I couldn't find fpreport.  So, I just removed the old Lazarus installation from my development machine and downloaded the latest version of Lazarus and installed it successfully.

I found this:  C:\Lararus\fpc\3.2.0\source\packages\fcl-report.  I opened this in Lazarus and the report designer appeared.  I created a simple report, very nice.  BUT, is it a compiled app or is it suppose to be accessed from within the Lazarus IDE menus?

Thanks guys for getting me this far !
TD  :D
Title: Re: How do I install/use FPReport?
Post by: af0815 on January 09, 2021, 07:10:34 pm
The designer is not built in, but you can configure it as an external tool in the Lazarus IDE. Normal the designer reside in ???\lazarus\components\fpreport\design . The Package is in ???\lazarus\components\fpreport.

There is also a demon for Lazarus in Tools/Example Projects and search for fpreport
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 11, 2021, 01:44:25 am
When I compile C:\Lazarus\components\fpreport I am getting the error "svn not in path". What this about and how do I fix it?

TD  :(
Title: Re: How do I install/use FPReport?
Post by: trev on January 11, 2021, 02:09:38 am
Is Subversion (svn) installed?

Is it really an error - it's usually merely a warning because it is usually only used to add the revision number to the compiled file.
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 11, 2021, 04:46:11 am
You are correct, it is a warning.  I will try to capture a screen shot of it and post it.   In the mean time I now have FpReport in the Lazarus IDE.  I placed a TFPReport and a TFPDatasetData on a form then double clicked the TFPReport  to get the report designer to open.  In the designer, under the "Report" section of the menu bar, the "Report Data" is missing.  With that missing, how does one connect the report to the data?

TD  :o 
Title: Re: How do I install/use FPReport?
Post by: af0815 on January 11, 2021, 06:11:43 pm
Are the SQL-DB (NOT Zeos) and DB-Components installed ?
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 11, 2021, 06:28:43 pm
Yes, they are installed on a datamodule and they are SQLdb components.

*************************************************************

Also, I have compiled the FPReport Designer, in c:\lazarus\components\fpreport\design. The designer opens ok but on close I get this error (see attached screen capture also):

Heap dump by heaptrc unit of  C:\Lazarus\component\fpreport\design\reportdesign.exe
29804 memory blocks allocated: 3844993/3950096
29804 memory blocks freed : 3844996/3950096
0 unfreed memory blocks: 0
True heap size:884736 (80 used in System startup)
True free heap:884656

I need help resolving either or both of these issues with the report designer please,
TD
Title: Re: How do I install/use FPReport?
Post by: af0815 on January 11, 2021, 06:33:47 pm
This it not a Error, it is a information from Heaptrace. 0 unfreed blocks means, all ok. Look in the Project Options, Compiler Option -> Debugging, you can deactivate Heaptrace if needed.
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 13, 2021, 07:59:41 pm
I have got the fpreport designer working thanks to you guys.  I created a new report with a "Report Data" which is a SQLite database.

Attached is a screen capture of the report in preview.  The first column on the database table is numeric.  The second column is a string and should look like this: "001234".  The third column is also a string and is the name of the business. 

Obviously the second and third columns are not showing the data correctly so what is wrong here? 

TD
Title: Re: How do I install/use FPReport?
Post by: af0815 on January 13, 2021, 10:41:02 pm
If you can post a sample, it will possible to find the issue. Is the Data correct ?
Title: Re: How do I install/use FPReport?
Post by: dodgebros on January 14, 2021, 11:20:36 pm
Thanks to everyone who tried to help with my quest to use fpreports.  After much thought I have decided to use LazReports for now.

TD
TinyPortal © 2005-2018