How to use custom Delphi function in FastReport 4?

左心房为你撑大大i 提交于 2019-12-10 12:00:54

问题


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


回答1:


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;



来源:https://stackoverflow.com/questions/15730822/how-to-use-custom-delphi-function-in-fastreport-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!