質問

I want to use custom Delphi function in FastReport that I can use of the function for some frxMemoView in design time. I find some suggestion in web such as Addfunction in fast report but I can't see my function in function tab in FastReport. please help me.

Thanks Hosein

役に立ちましたか?

解決

The example in then Using Custom Functions in a Report mentioned by TLama works nearly fine.

There a two problems you might have tripped over.

First: Documentation has two bugs in constructor TFunctions.Create; A missing begin, and a supernumerary '
the corrent implementaion would be

constructor TFunctions.Create;
begin
inherited Create(AScript);
with AScript do
   begin
   AddMethod('function MyFunc(s: String; i: Integer): Boolean', CallMethod,
            'My functions', ' MyFunc function always returns True');
   AddMethod('procedure MyProc(s: String)', CallMethod,
            'My functions', ' MyProc procedure does not do anything');
   end;
end;

The second "problem" is you can not expect to see the functions in the IDE by double clicking on the report, the selection is only availble if you call DesignReport at runtime. This option is not available in the limited edition shipped with XE3.

begin
   //......
   frxReport1.DesignReport;
  //......
end;

example

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top