OnGetValue compare with FreeReport
Hi Everybody,
I'v just first time run FastReport 4 and I see that OnGetValue works different than in FreeReport.
I want to format DataValue for each record but FR4 doesn't call OnGetValue for data field as .
Do You know how can I write code below in XE+FR4?
I don't whant to use a script inside FR4, I prefer code in my Delhi unit.
I'v just first time run FastReport 4 and I see that OnGetValue works different than in FreeReport.
I want to format DataValue for each record but FR4 doesn't call OnGetValue for data field as .
Do You know how can I write code below in XE+FR4?
I don't whant to use a script inside FR4, I prefer code in my Delhi unit.
// D7+FreeReport
procedure TfrForm.frReport1GetValue(const ParName: String; var ParValue: Variant);
begin
if ParName='Query1."Number"' then
  begin
    if Query1Number.Value>1000 then
      ParValue:=FloatToStrF(Query1Number.Value,fffixed,15,2)
    else
    if Query1Number.Value>100 then
      ParValue:=FloatToStrF(Query1Number.Value,fffixed,15,3)
    else
    if Query1Number.Value>10 then
      ParValue:=FloatToStrF(Query1Number.Value,fffixed,15,4)
    else
      ParValue:='';
  end;
end;
Comments
1. On the Delphi form frxDataSet1.DataSet:=Query1
2. Create variable (eg. Num1 ) on the report and assign it to frxDBDataSet desired field (eg. Number)
3. Place text label on the report and assign it to variable Num1
4. In the Delphi code:
Any other idea?
Best regards.