Recent

Author Topic: Compilation error while installing lazreportpdfexport 0.9  (Read 2621 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Compilation error while installing lazreportpdfexport 0.9
« on: June 18, 2024, 12:34:50 pm »
Hi

I'm trying to install lazreportpdfexport using install/uninstall packages in Lazarus 3.4 (and FPC 3.2.2)

I have noticed that it requires now powerpdf 0.9.16 and it was installed (from lazarus-ccr).

There are compilation errors :
Code: Pascal  [Select][+][-]
  1. Compile package pack_powerpdf 0.9.16: Success, Warnings: 9, Hints: 23
  2. [...]
  3. Report.pas(1348,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  4. PReport.pas(1363,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  5. PReport.pas(1559,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  6. [...]
  7. Compile package lazreportpdfexport 0.9: Exit code 1, Errors: 2
  8. lr_e_pdf.pas(539,19) Error: identifier idents no member "SubType"
  9. lr_e_pdf.pas(540,26) Error: identifier idents no member "URI"
  10. Codetools, Errors: 1
  11. lr_e_pdf.pas(32,23) Error: unit not found: lr_rrect

Any ideas ?

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

paweld

  • Hero Member
  • *****
  • Posts: 1090
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #1 on: June 18, 2024, 01:30:57 pm »
This component has always required PowerPDF (which is now obsolete).
You are probably referring to the lr_pdfexport 0.9 component, which does not require any external components (it uses the functionality built into FPC)
Best regards / Pozdrawiam
paweld

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #2 on: June 18, 2024, 06:53:50 pm »
Thanks for the information !

I understand that I have to replace the package lazreportpdfexport by lr_pdfexport

But I can't find any documentation about the new package, let alone instruction for the migration.

The Lazreport documentation still refer only to lazreportpdfexport and PowerPdf



Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Thaddy

  • Hero Member
  • *****
  • Posts: 15202
  • Censorship about opinions does not belong here.
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #3 on: June 18, 2024, 07:07:50 pm »
fcl-pdf?
Of course the national anthem of the U.S.A. was written by Jimi Hendrix, didn't you know that?

paweld

  • Hero Member
  • *****
  • Posts: 1090
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #4 on: June 18, 2024, 07:09:06 pm »
Lazarus:- Main menu > packages > install / uninstall package - On the right side of the window, type in the search box: pdfexport
- select "lr_pdfexport 0.9"
- press "install package" button
- then "save and rebuild ide"
Best regards / Pozdrawiam
paweld

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #5 on: June 18, 2024, 11:03:10 pm »
Lazarus:- Main menu > packages > install / uninstall package - On the right side of the window, type in the search box: pdfexport
- select "lr_pdfexport 0.9"
- press "install package" button
- then "save and rebuild ide"

Eh, I was able to do that !   ::)

Currently, Lazarus building and project compilation are fine, but I have runtime errors.
Code: Pascal  [Select][+][-]
  1. Unable to find the component class "TfrTNPDFExport".
  2. It is not registered via RegisterClass and no lfm was found

I suppose the class TfrTNPDFExport was in the removed package, and that I should replace it everywhere by a similar one from the new package, possibly lrpdfexport.
After that, I'll have to see if the properties and behaviour are the same...

It takes a lot of time to discover and check all this when there is no reliable documentation.... >:(


Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #6 on: June 18, 2024, 11:06:15 pm »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

paweld

  • Hero Member
  • *****
  • Posts: 1090
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #7 on: June 19, 2024, 06:38:11 am »
With the previous component you exported the report to PDF as follows:
Code: Pascal  [Select][+][-]
  1. if frReport1.PrepareReport then
  2.   frReport1.ExportTo(TFrTNPDFExportFilter, 'report.pdf');
and now you need to export as below:
Code: Pascal  [Select][+][-]
  1. uses
  2.   lr_e_fclpdf;
  3.  
  4. //...
  5.  
  6. if frReport1.PrepareReport then
  7.   frReport1.ExportTo(TlrPdfExportFilter, 'report.pdf');
in the project inspector you need to add a new requirement - package lr_pdfexport
Best regards / Pozdrawiam
paweld

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #8 on: June 19, 2024, 03:08:22 pm »
Hi

In my projects, I don't export by code.
The exports are only created by users, clicking on a button in a preview.
The previews are obtained by
Code: Pascal  [Select][+][-]
  1. Report.ShowReport

So, I can't make the suggested changes.

frTNPDFExport is still referenced in many .lfm files, but none used before the runtime error occurs, that's strange.
However, I'll try to remove them, but it will require a lot of work...

And, yes, I had already added the requirement to the new package.

Thanks
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #9 on: June 24, 2024, 05:27:03 pm »
Hi

The type TfrTNPDFExport was present in many .lfm files, all using a frame where an object of this type was present. I think it was required with previous versions to allow export from the report preview.

Now I have changed TfrTNPDFExport to TlrPDFExport in every source file (.lfm .pas .lpr), and checked the string TfrTNPDFExport is no more  present in any file.

Compilation and linking are OK.

But at runtime, there is still the same error : Unable to find the component class "TfrTNPDFExport"

It is called by InitLazResourceComponent in lresources.pp line 364   [I'm using Lazarus 3.4]

My question is how can I find out why this class is tried to be loaded.

Thanks
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jesusr

  • Sr. Member
  • ****
  • Posts: 496
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #10 on: June 25, 2024, 04:37:39 am »
Hi

I'm trying to install lazreportpdfexport using install/uninstall packages in Lazarus 3.4 (and FPC 3.2.2)

I have noticed that it requires now powerpdf 0.9.16 and it was installed (from lazarus-ccr).

There are compilation errors :
Code: Pascal  [Select][+][-]
  1. Compile package pack_powerpdf 0.9.16: Success, Warnings: 9, Hints: 23
  2. [...]
  3. Report.pas(1348,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  4. PReport.pas(1363,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  5. PReport.pas(1559,5) Warning: Symbol "OffsetRect" is deprecated: "Use Types.OffsetRect instead"
  6. [...]
  7. Compile package lazreportpdfexport 0.9: Exit code 1, Errors: 2
  8. lr_e_pdf.pas(539,19) Error: identifier idents no member "SubType"
  9. lr_e_pdf.pas(540,26) Error: identifier idents no member "URI"
  10. Codetools, Errors: 1
  11. lr_e_pdf.pas(32,23) Error: unit not found: lr_rrect

Any ideas ?

A newer LazReport (Lazarus) version requires a newer version of PowerPDF, 0.9.16 release do not contain the needed changes.
PowerPDF 0.9.17 is now available in lazarus-ccr, that should work.

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #11 on: June 25, 2024, 09:35:19 am »
Quote from: jesusr
PowerPDF 0.9.17 is now available in lazarus-ccr, that should work.

So, I downloaded and installed this package 0.9.17, but the first thing I see during installation is that is is still labelled 0.9.16...












Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

paweld

  • Hero Member
  • *****
  • Posts: 1090
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #12 on: June 25, 2024, 12:25:04 pm »
And did you also remove the references to the component in the object inspector (Project > Project inspector > Required packages > select "lazreportpdfexport" > Remove) and did you remove the "lr_e_pdf" entity from the uses section in the *.pas files?
Best regards / Pozdrawiam
paweld

tintinux

  • Sr. Member
  • ****
  • Posts: 333
    • Gestinux
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #13 on: June 25, 2024, 02:22:27 pm »
Quote from: paweld
did you also remove the references to the component in the object inspector (Project > Project inspector > Required packages > select "lazreportpdfexport" > Remove) and did you remove the "lr_e_pdf" entity from the uses section in the *.pas files?
Yes, I did !
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jesusr

  • Sr. Member
  • ****
  • Posts: 496
Re: Compilation error while installing lazreportpdfexport 0.9
« Reply #14 on: June 25, 2024, 09:15:22 pm »
Sorry, I screwed up. I will correct it later.
It should work OK anyway as it now include the needed changes and provided that you don't update Lazarus, because the new Lazarus version requires 0.9.17.

 

TinyPortal © 2005-2018