繁体   English   中英

如何在FastReport 4中使用自定义Delphi函数?

[英]How to use custom Delphi function in FastReport 4?

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

谢谢侯赛因

TLama提到的“ 在报表使用自定义函数”中的示例几乎可以正常工作。

您可能遇到了两个问题。

首先:文档在构造函数TFunctions.Create中存在两个错误; 缺少开始,而多余的'
适当的实施将是

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随附的限量版中没有此选项。

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

例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM