如何在FastReport 4中使用自定义的Delphi函数? [英] How to use custom Delphi function in FastReport 4?

查看:417
本文介绍了如何在FastReport 4中使用自定义的Delphi函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在FastReport中使用自定义的Delphi函数,我可以在设计时使用一些frxMemoView的函数。
我在网上找到了一些建议,例如快速报告中的Addfunction,但是我在FastReport的函数选项卡中看不到我的功能。
请帮助我。

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.

感谢
Hosein

Thanks Hosein

推荐答案

然后在报告中使用自定义函数

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

一个> TLama提到的工作几乎没有问题。

There a two problems you might have tripped over.

有两个问题你可能已经绊倒了。

第一:文档在构造函数TFunctions.Create中有两个错误;一个失踪的开始,以及一个额外的'

的实现实现将是

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;

第二个问题是你不能期望通过双击看到IDE中的函数该报告,如果您在运行时调用DesignReport,则选择仅适用。此选项不适用于XE3附带的限量版。

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;

这篇关于如何在FastReport 4中使用自定义的Delphi函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆