Inheritance and procedure
Hello everyone,
First of all, english isn't my native language so please excuse me in advance.
I'm using Delphi XE, FR5 and PascalScript for the report.
I have a report called R1.fr3 with a few procedure in it, and this one:
And I call it like this
If I call this procedure from the R1.fr3 report, there is no probleme everything's working fine, all the display format of the tfrxMemoView are changed.
But, if I make a new report who inherit from the R1.fr3 one, i can call it the same way, but it's not doing anything.
Does someone have an idea on how to do this?
Thanks in advance!
(dont know how to put the topic as "solved", if an admin can do it it would be great)
First of all, english isn't my native language so please excuse me in advance.
I'm using Delphi XE, FR5 and PascalScript for the report.
I have a report called R1.fr3 with a few procedure in it, and this one:
procedure ChgFormatCurrency(Obj:TfrxComponent; AncFormat,NewFormat:String);
var i:integer;
begin
for i:=0 to Obj.Objects.count-1 do
ChgFormatCurrency(TfrxComponent(Obj.Objects[i]), AncFormat, NewFormat);
if Obj is TfrxMemoView then
if TfrxMemoView(Obj).DisplayFormat.formatStr = AncFormat then
TfrxMemoView(Obj).DisplayFormat.formatStr := NewFormat;
end;
And I call it like this
ChgFormatCurrency(Report, '%2.0m', '%2.2m');
If I call this procedure from the R1.fr3 report, there is no probleme everything's working fine, all the display format of the tfrxMemoView are changed.
But, if I make a new report who inherit from the R1.fr3 one, i can call it the same way, but it's not doing anything.
Does someone have an idea on how to do this?
Thanks in advance!
(dont know how to put the topic as "solved", if an admin can do it it would be great)
Comments
(Maybe it's because i've moved my procedure on top, but I really don't know =/)
As far as I know, it is not currently possible to inherit the code of the parent report as it can be done in Delphi with "inherited;". If a procedure is overriden (redeclared in the child report), FastReport will only call the code of the child report. If an event is not located in the child report, it will look in the parent report for it.