Recent

Author Topic: Forte Report CE Questions  (Read 1690 times)

PascalProg

  • Newbie
  • Posts: 6
Forte Report CE Questions
« on: July 07, 2025, 12:05:23 am »
Hi
Does anyone know how to sum a text field that contains data like '123.22' using RLDBResult
For example  RLDBText contains values like 123.21 and  RLDBResult contains Sum[RLDBText] which is show 0 when the report is run because RLDBText contains text instead of float.
« Last Edit: July 07, 2025, 04:15:09 am by PascalProg »

jamie

  • Hero Member
  • *****
  • Posts: 7708
Re: Forte Report CE Questions
« Reply #1 on: July 07, 2025, 01:17:44 am »
I don't know but you could look at the documentation which I am sure is somewhere on the net.

But you could even look here at the meat of the code, lots of interesting files there


https://github.com/fortesinformatica/fortesreport-ce

The only true wisdom is knowing you know nothing

PascalProg

  • Newbie
  • Posts: 6
Re: Forte Report CE Questions
« Reply #2 on: July 07, 2025, 04:17:09 am »
Thanks for the reply
No documentation available only API and its in Portuguese.
Working on Translation.

I could really use some code samples other then the ones provided by Fortes4Lazarus, the examples are good but limited.
« Last Edit: July 07, 2025, 04:19:40 am by PascalProg »

mtrsoft

  • Jr. Member
  • **
  • Posts: 64
Re: Forte Report CE Questions
« Reply #3 on: July 07, 2025, 07:48:54 am »
Hope this helps.

Code: Pascal  [Select][+][-]
  1. procedure TfrmReport030A.RLDBResult1BeforePrint(Sender: TObject; var OutputText: string; var PrintIt: boolean);
  2. begin
  3. OutputText := FormatFloat(RLDBResult1.DisplayMask, RLDBResult1.Value);
  4. end;
  5.  

Note: This is in the "Before Print" event of the relevant report field.

The above was done using Forte4Lazarus 3.24 obtained from the OPM.

A side note: I found that when including images in the reports there was a bug that resulted in a memory leak. If that's an issue for you I do have a fix for it. Let me know if you'd like it and I can attach it to a future reply.

PascalProg

  • Newbie
  • Posts: 6
Re: Forte Report CE Questions
« Reply #4 on: July 07, 2025, 11:38:16 pm »
Hi Mtrsoft
Thanks for the reply. It got me further in trying to understand what Forte does but alas it didn't give the expected result
The RLDBResult1 still does not sum the contents of RLDBText5. Any other suggestions. I can send more info if you need it.
I would also like to take you up on that memory leak fix since I am using Images in the reports.

Thanks

mtrsoft

  • Jr. Member
  • **
  • Posts: 64
Re: Forte Report CE Questions
« Reply #5 on: July 08, 2025, 12:34:54 am »
The attached 7zip file contins the two *.pas files that have the changes needed to fix the memory leak.
They should be located in the directory
C:\users\username\AppData\local\onlinepackagemanager\ packages\fortes4lazarus3.24

Make sure you rename / backup the original files before replacing them.

In the files you can locate the changes by searching for the comment //JR: .

I'll take another look to see how I implemented the summing. -- It's been a few years since I created the reports, so....

If you want to see a example report go to the website www.fitall.com and the menu items Downloads > SIP > Evaluation Edition.
(The Simple Inventory Program Evaluation Edition does not allow the actual printing or saving of the pdf reports that are generated.)

PascalProg

  • Newbie
  • Posts: 6
Re: Forte Report CE Questions
« Reply #6 on: July 08, 2025, 01:32:42 am »
WoW Thanks

That sips program is nice and the reports look like what I need to write.
If you can send the code snippets of how you achieved the results that would be great.
The report software I use to use were fastreport but sadly they don't support Delphi 12 CE at all.
So it off to learn a new reporting software.

Thanks again for all your help and Thanks for the Fortes4LAzFixes.
« Last Edit: July 08, 2025, 01:36:18 am by PascalProg »

PascalProg

  • Newbie
  • Posts: 6
Re: Forte Report CE Questions
« Reply #7 on: July 10, 2025, 07:24:17 pm »
 Hi MTRSoft

Any luck on the sample report code snippets? :D

Thanks

mtrsoft

  • Jr. Member
  • **
  • Posts: 64
Re: Forte Report CE Questions
« Reply #8 on: July 11, 2025, 07:08:19 am »
Sorry for the delay.

I really couldn't find anything terrifbly useful.

Here a couple for the Before Print events.

OutputText := FormatFloat(rlDBText3.DisplayMask, rlDBText3.Field.AsFloat);

(The above is required to ensure that the field value is treated as a Float).

OutputText := FormatFloat(RLDBResult1.DisplayMask, RLDBResult1.Value);

I think  you will find it useful to look at the demos that are included with the Forte Report installation.

One thing to note / look at is that the fields must be placed on a "Band" and the band type must be properly set (in the Object Inspector). -- Exampe settings are: btDetail, btSummary.

Also don't forget to set the "Data Field" or "Data Formula". It's easy to forget.

If you are creating subtotals you will need to use a Group Band and within that band include a Details and a Summary band.

I hope this is of some help.

Good luck.

PascalProg

  • Newbie
  • Posts: 6
Re: Forte Report CE Questions
« Reply #9 on: July 11, 2025, 08:26:14 pm »
Thanks a bunch for all your help
I'll give this a try

 

TinyPortal © 2005-2018