Cant sum two variables
Leo Bidi
Montevideo, Uruguay
Hi, I have two variables in the page footer on the second page of a report.
The two variables are printed correctly but when I try to put this code
[<tVar1> + <tvar2>] in another memo to sum both variables, i get only
the same text as the formula. What i am doing wrong ?? I did this all the time
and now cant see the problem.
Thanks
Comments
G'day Leo,
How did you "populate" the Memo? Did you type the formula as you see it above, or did you use FR's "helper" (Insert Aggregate or something similar) to create it? Did you "drag" the Variables into the Memo Text?
I don't know why but I am a bit suspicious of the syntax in your example! The mix of square and angle brackets look "problematic" - but I don't have FastReports available right now to check it out.
Have you tried:
[tVar1] + [tvar2]
?
We have a lot of formulae in our multitude of reports and don't get the sort of problem you report. Having said that, for anything complex we usually fall back to Delphi Code 😉
Cheers, Paul
Can you attach your report template (fr3) here?
here is my code on designer
procedure Memo105OnBeforePrint(Sender: TfrxComponent);
begin
try
Memo105.text:=formatfloat('#0.00', (StrToFloat(<tVar1>)+StrToFloat(<tVar1>) ) ))
except end;
end;
Note: make sure you have correct open /close ( or ) ..