fastreport自定义函数的问题! (30分)

  • 主题发起人 delphiere
  • 开始时间
D

delphiere

Unregistered / Unconfirmed
GUEST, unregistred user!
帮助说在onUserFunction事件中,自定义函数后,
就可以在报表中使用自定义的这个函数了!
为什么我定义完了之后,在Tfrmemoview的text editor里面的没有看到。我刚才定义的那个funciton呢?
数据字典里面也没有呀!高手们能和我说说吗?谢谢了!
 
应该在自定义函数库中注册自定义函数
TMyFunctionLibrary = class(TfrFunctionLibrary)
public
constructor Create;
override;
proceduredo
Function(FNo: Integer;
p1, p2, p3: Variant;
var val: Variant);
override;
end;

constructor TMyFunctionLibrary.Create;
begin
inherited Create;
with Listdo

begin

Add(你的函数名');
end;
end;

procedure TMyFunctionLibrary.DoFunction(FNo: Integer;
p1, p2, p3: Variant;
var Val: Variant);
begin
Val := 0;
case FNo of
0: Val := 你的函数(frParser.Calc(p1));
//
end;
end;
 
接受答案了.
 
顶部