Lazarus

Programming => Packages and Libraries => Topic started by: Mocte on August 24, 2017, 03:55:07 am

Title: FPReport testing
Post by: Mocte on August 24, 2017, 03:55:07 am
Hi everyone

Just reporting my first experience with fpreport, I updated FPC + Lazarus trunk on a Windows 7 VM 64 bits using FPCupdeluxe, with the sole purpose of compiling fpreport demo and check how it looks like, I found that it was not posible to compile the lclfpreport package, at first because missing units, the very first error I got was something like: Cannot find fpreport used by cfg...  I double checked the fpreport folder and indeed the file was missing, then I went to fpgui repository on github and pulled that file ( and others missing ) from there, then I got another error: "fpreport - Illegal unit name", I'm not familiar at all with Lazarus yet, I solved it by renaming the unit to fpreport_ but then I had to correct a lot of references to the original name, at the end succeeded on my adventure of compiling lclfpreport, then I proceeded to compile the demo, I had an experience similar to the previous one plus changing some defines and installing freetype on windows but at the end all went fine and I could ran the demo from the command line, I did the same more or less for the IDE packages, played a little bit with the designer, it looks neat :-).

As I stated before I'm not that familiar with packages and Lazarus, I'm sure renaming fpreport file can be avoided  %)

Now, I'm not sure it is safe to mix code from the two repositories, everything compiles and works fine AFAICS but I would prefer to pull all the source from the same place, perhaps it is not available in trunk yet? 

Anyway wonderful work you have done there, I just wanted to have a taste of fpreport and it looks promising, keep up the good work, I'll be looking forward for future commits.

Thank you all.


 
Title: Re: FPReport testing
Post by: Pascal on August 24, 2017, 09:25:47 am
Did you see the README in components/fpreport?
Code: Text  [Select][+][-]
  1. Compiling:
  2.  
  3. - Run-time package:
  4.   lclfpreport.lpk
  5. - Report Designer windows and functionality:
  6.   design/lazfprepordesign.lpk
  7. - FPreport component IDE registration and design-time support:
  8.   design/lazidefpreport.lpk
  9. - Standalone designer:
  10.   design/reportdesign.lpr
  11. - Demos: demos/fcldemo.lpr
  12.  
  13. Before compiling demos:
  14.  
  15. Copy the contents of the FPC fcl-report/demo directory to the demo
  16. directory.
  17.  
  18. Check the various defines in udapp.pp and demos.inc:
  19.  
  20. EXPORTPDF - enable export to PDF
  21. EXPORTFPIMAGE - enable export to image
  22. EXPORTHTML - enable export to html
  23.  
  24. To enable the following defines, check the lcldemo project
  25. EXPORTLCL - enable export to LCL (preview)
  26.  
  27. Running on windows:
  28. If EXPORTFPIMAGE is defined, the freetype.dll is needed.

I just did a test on Win10 x64.
Fresh checkout of fpc and lazarus.
Building fpc and lazarus.
After installing the 3 packages, adding the freetype-6.dll to laz and demo directory and rebuilding the ide i could run the sample prog from the ide without any changes.
Title: Re: FPReport testing
Post by: Mocte on August 24, 2017, 01:50:42 pm
Did you see the README in components/fpreport?
Code: Text  [Select][+][-]
  1. Compiling:
  2.  
  3. - Run-time package:
  4.   lclfpreport.lpk

Of course I did but in order to follow the instructions first you must have the complete set of files that make up the package, e.g. to compile lclfpreport.lpk you need fpreport.pp and it is not there :o, the same with other files, thats why I pulled them from fpgui repository.

I just did a test on Win10 x64.
Fresh checkout of fpc and lazarus.
Building fpc and lazarus.
After installing the 3 packages, adding the freetype-6.dll to laz and demo directory and rebuilding the ide i could run the sample prog from the ide without any changes.

May be I'm not checking out the correct revision/branch, but as I already said I'm using FPCupdeluxe and I'm trusting in the automated process it does to update from trunk, btw I cannot see the missing files browsing : https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/fpreport/?root=lazarus (https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/fpreport/?root=lazarus) or Graeme's mirror on github https://github.com/graemeg/lazarus/tree/upstream/components/fpreport (https://github.com/graemeg/lazarus/tree/upstream/components/fpreport), and don't take me wrong, I'm not complaining, the motivation of this post was to make the right people aware that maybe some files were not commited, but If you have them all with a simple checkout then the problem is elsewhere.

I'm sure I should not be touching the code e.g. renaming units, but that was the path I had to go to succeed.
Title: Re: FPReport testing
Post by: DonAlfredo on August 24, 2017, 01:58:33 pm
Perhaps I can help.

Strangely enough, I did encounter an update problem (perhaps the same problem as OP) while updating trunk with fpcupdeluxe just yesterday !

To solve, I had to remove the whole fpcsrc-directory. And run fpcupdeluxe again.

I am still looking into this. But I could not reproduce this error after solving it. It has something to do with the way svn is used (svn gave an error while updating trunk).
Title: Re: FPReport testing
Post by: Groffy on August 24, 2017, 02:42:15 pm
The fpc wiki page

http://wiki.freepascal.org/Road_map

seems to be outdated. For which release is the FPReport integration planned? For fpc3.0.4 its too late


Best regards
Title: Re: FPReport testing
Post by: Graeme on August 25, 2017, 12:23:58 am
Just reporting my first experience with fpreport, I updated FPC + Lazarus trunk on a Windows 7 VM 64 bits using FPCupdeluxe,

I update my repositories using my Git mirrors of FPC and Lazarus - I've never used FPCupdeluxe and don't actually know what it offers or does. Either way, I update FPC Trunk (3.1.1) and recompiled it and installed it as I normally do with FPC trunk. I then updated Lazarus - though LCL is not strictly needed for testing fpReport and it is toolkit independent and 100% non-GUI enabled.

I managed to open the demos/fcldemo.lpi directory from the FPC source and it compiled without problems.

Quote
Anyway wonderful work you have done there, I just wanted to have a taste of fpreport and it looks promising, keep up the good work, I'll be looking forward for future commits.
Thanks, it was a joy developing fpReport. A very interesting task. So too was fpPDF and fpTTF. :)  The latter two were actually way more challenging than fpReport.

Regards,
  Graeme
Title: Re: FPReport testing
Post by: Graeme on August 25, 2017, 12:29:54 am
seems to be outdated. For which release is the FPReport integration planned? For fpc3.0.4 its too late

I guess the aim was for FPC 3.0.4 seeing as it is brand new and doesn't affect anything else. Just like fpPDf and fpTTF was backported and released for FPC 3.0.2. But maybe Michael van Canneyt waited too long to add it to FPC Trunk. Either way, what is done is done.

Good news is than nothing prevents you from using fpReport, fpPDF and fpTTF with FPC 2.6.4 and later. Simply copy the relevant [packages] code from FPC Trunk, and it to your existing setup's search path and away you go. And yes, all three packages work with FPC 2.6.4 too.
Title: Re: FPReport testing
Post by: Mocte on August 25, 2017, 12:53:09 am

I update my repositories using my Git mirrors of FPC and Lazarus - I've never used FPCupdeluxe and don't actually know what it offers or does. Either way, I update FPC Trunk (3.1.1) and recompiled it and installed it as I normally do with FPC trunk. I then updated Lazarus - though LCL is not strightly needed for testing fpReport and it is toolkit independent and 100% non-GUI enabled.

I managed to open the demos/fcldemo.lpi directory from the FPC source and it compiled without problems.

Thanks, it was a joy developing fpReport. A very interesting task. So too was fpPDF and fpTTF. :)  The latter two were actually way more challenging than fpReport.

Regards,
  Graeme

Perhaps I can help.

Strangely enough, I did encounter an update problem (perhaps the same problem as OP) while updating trunk with fpcupdeluxe just yesterday !

To solve, I had to remove the whole fpcsrc-directory. And run fpcupdeluxe again.

I am still looking into this. But I could not reproduce this error after solving it. It has something to do with the way svn is used (svn gave an error while updating trunk).

The more I think about it, the more I convince myself that it is an omission on my side, unfortunately my lazarus time is limited, but on the positive side I'm getting used to the Lazarus ways, please bear with me I will improve over time  :)

Title: Re: FPReport testing
Post by: Groffy on August 26, 2017, 11:36:37 am
Good news is than nothing prevents you from using fpReport, fpPDF and fpTTF with FPC 2.6.4 and later. Simply copy the relevant [packages] code from FPC Trunk, and it to your existing setup's search path and away you go. And yes, all three packages work with FPC 2.6.4 too.

I already thought about that, which packages do I need from the fpc trunk?

fcl-report
fcl-pdf

which one is containing the fpTTF?


Best regards
Title: Re: FPReport testing
Post by: JZS on August 28, 2017, 08:34:03 am
Please help. I can not install FPReport!

I tried for several days and non from my efforts has worked.

I ended up with the attached message after installing the sources and placing the DLL in WIn Dir (and just in case in the Lazarus folder as well).

Sorry for posting under this thread.
Title: Re: FPReport testing
Post by: Graeme on August 28, 2017, 04:56:23 pm
fcl-report
fcl-pdf

which one is containing the fpTTF?

Yes, those are the two packages. The fpTTF code is now included in the "fcl-pdf/src/" directory.
Title: Re: FPReport testing
Post by: Graeme on August 28, 2017, 04:59:09 pm
Please help. I can not install FPReport!

Please see the <fpc_src>/packages/fcl-report/demos/compiling.txt file and follow those instructions. If you still have an error, please supply a backtrace, as the error screenshot you send doesn't give much information to go with. The WIKI explains how to produce a backtrace in case you don't know.
Title: Re: FPReport testing
Post by: JZS on September 01, 2017, 07:58:03 am
Please see the <fpc_src>/packages/fcl-report/demos/compiling.txt file and follow those instructions. If you still have an error, please supply a backtrace, as the error screenshot you send doesn't give much information to go with. The WIKI explains how to produce a backtrace in case you don't know.

That is the problem Graeme. I did not reach that far. I am stuck in the first compiling steps fpreport/README.txt:
Compiling:

- Run-time package:
  lclfpreport.lpk compiled this, check
- Report Designer windows and functionality:
  design/lazfprepordesign.lpk and compiled this, check
- FPreport component IDE registration and design-time support:
  design/lazidefpreport.lpk I am stuck here.When compiled this and installed, and when asked to rebuild I clicked yes, then upon restarting I receive the "Cannot find freetype-6.dll" when placing the DLL in the System Folder, Lazarus does not want to start anymore and gives that message "The application was unable to start correctly..." and Lazarus does not start until I rebuild with "make clean" and then I remove FPReport before rebuilding to reload the installed packages.
- Standalone designer:
  design/reportdesign.lpr
- Demos: demos/fcldemo.lpr

Before compiling demos:

Copy the contents of the FPC fcl-report/demo directory to the demo
directory.


Thanks Graeme, appreciate your support.

PS: I am on Win 7, 64bit, tried with Lazarus 1.8RC4 and Lazarus 1.9
Title: Re: FPReport testing
Post by: Pascal on September 02, 2017, 05:58:23 am
JZS, what target did you compile to? 32bit or 64bit?
The dll has to fit to this. For testing just copy the appropriate dll in the folder of the lazarus exe
and you are done.
Title: Re: FPReport testing
Post by: JZS on September 02, 2017, 02:37:19 pm
Thanks Pascal. Now I got it working. It was the "zlib1.dll" that was missing to be placed next to the FreeType DLL.
Title: Re: FPReport testing
Post by: JZS on September 02, 2017, 02:47:49 pm
Cont., later when working with the data, an error about Missing Font will be triggered "LiberationSans":
Downloaded from here (https://github.com/taylor/fonts/blob/master/LiberationSans-Regular.ttf) and it worked.
Still finding out a way to generate a sample though.

Many thanks Graeme and Lazarus Team.
Title: Re: FPReport testing
Post by: JD on September 03, 2017, 03:54:26 pm
Well I've been looking forward to this for a long time. Many thanks to Graeme & the development team. I want to know if it is possible to export reports to the RTF format. I have a use case at the moment where reports generated need to be modifiable in Microsoft Word. The RTF format is the closest I think of to Microsoft Word.

Thanks,

JD
Title: Re: FPReport testing
Post by: mobilevil on September 04, 2017, 11:26:58 am
GDB itself crashes when I am playing around with the report designer component. maybe my SVN build is bad?
Title: Re: FPReport testing
Post by: Graeme on September 04, 2017, 01:25:58 pm
I want to know if it is possible to export reports to the RTF format. I have a use case at the moment where reports generated need to be modifiable in Microsoft Word.
There is no RTF exporter for fpReport. Contributions are obviously very welcome. You might be able to use the HTML Exporter for now, as Microsoft Word and LibreOffice Writer can edit HTML and then resave that in another format like DOC, ODT or RTF.
Title: Re: FPReport testing
Post by: JD on September 04, 2017, 10:59:31 pm
I want to know if it is possible to export reports to the RTF format. I have a use case at the moment where reports generated need to be modifiable in Microsoft Word.
There is no RTF exporter for fpReport. Contributions are obviously very welcome. You might be able to use the HTML Exporter for now, as Microsoft Word and LibreOffice Writer can edit HTML and then resave that in another format like DOC, ODT or RTF.

OK Thanks. I'll see what I can do with that.
Title: Re: FPReport testing
Post by: reminder2k1 on September 27, 2017, 12:40:34 am
Thanks Pascal. Now I got it working. It was the "zlib1.dll" that was missing to be placed next to the FreeType DLL.

JZS, how did you fix the freetype-6.dll loading? i still have same problem.
Title: Re: FPReport testing
Post by: JZS on September 27, 2017, 03:38:34 am
JZS, how did you fix the freetype-6.dll loading? i still have same problem.

What error message did you get? Was it same as the one I attached?
Title: Re: FPReport testing
Post by: reminder2k1 on September 27, 2017, 06:15:05 am
JZS, how did you fix the freetype-6.dll loading? i still have same problem.

What error message did you get? Was it same as the one I attached?

yes, but i can found freetype-6.dll...
Title: Re: FPReport testing
Post by: mobilevil on September 27, 2017, 06:34:55 am
Is the dll in search path? If in doubt put it in the same folder as lazarus.exe
Title: Re: FPReport testing
Post by: reminder2k1 on September 27, 2017, 07:29:24 am
Is the dll in search path? If in doubt put it in the same folder as lazarus.exe

ya, but i still don't have this file? can you give me the url where can i download it ?
Title: Re: FPReport testing
Post by: molly on September 27, 2017, 08:05:43 am
ya, but i still don't have this file? can you give me the url where can i download it ?

There is a thread discussing the same topic, but relevant messages got a bit lost there:
freetype (for windows) is part of gnuwin (http://gnuwin32.sourceforge.net/packages/freetype.htm).
Don't forget to download the dependency archive as well (you need zlib dll from that) and store that next to your freetype dll.

More information is available in that thread, you could probably do with starting with my quoted message and read downwards.
Title: Re: FPReport testing
Post by: reminder2k1 on September 27, 2017, 12:23:44 pm
ya, but i still don't have this file? can you give me the url where can i download it ?

There is a thread discussing the same topic, but relevant messages got a bit lost there:
freetype (for windows) is part of gnuwin (http://gnuwin32.sourceforge.net/packages/freetype.htm).
Don't forget to download the dependency archive as well (you need zlib dll from that) and store that next to your freetype dll.


thx so much for your reply... it work right now...  :)
More information is available in that thread, you could probably do with starting with my quoted message and read downwards.
Title: Re: FPReport testing
Post by: Gizmo on September 27, 2017, 01:40:25 pm
Quote
Quote from: JD on 03-09-2017, 15:54:26
I want to know if it is possible to export reports to the RTF format. I have a use case at the moment where reports generated need to be modifiable in Microsoft Word.

See the lazdbexport package via Lazarus Package menu --> Install\Uninstall package list. You can export to RTF data from DBGrids and, I think, other data sources though I could be wrong there. I've just used it for exporting data to CSV and I noticed RTF was an option
Title: Re: FPReport testing
Post by: eldonfsr on October 05, 2017, 05:22:10 am
You have link to download
TinyPortal © 2005-2018