Recent

Author Topic: [Solved]ftFMTBcd Null Error  (Read 671 times)

gucao

  • New Member
  • *
  • Posts: 37
[Solved]ftFMTBcd Null Error
« on: April 19, 2022, 03:42:43 pm »
please see
https://forum.lazarus.freepascal.org/index.php/topic,59093.0.html

Follow the steps below to edit "C:\lazarus\components\lazreport\source\lr_dbrel.pas" can fix this issue


uses
  SysUtils, Classes, DB,FmtBCD{<---add FmtBCD};



function lrGetFieldValue(F: TField): Variant;
begin
  if Assigned(F) then
  begin
    if F.IsNull then
    begin
      if F.DataType in TypeStringField then
        Result:=''
      else
      if F.DataType in (TypeIntegerField + TypeNumericField) then
        Result:=0
      else
      if F.DataType in TypeBooleanField then
        Result:=false
      else
      if f.DataType = ftFMTBcd then //<---add this line
        Result:=VarFmtBCDCreate //<---add this line
      else
        Result:=null
    end
    else
      Result:=F.Value;
  end
  else
    Result:=null;
end;


The lr_dbrel.pas in the attachment is the modified file

i opened a issue
https://gitlab.com/freepascal.org/fpc/source/-/issues/39674
i need close it and reopen it to lazarus?

« Last Edit: April 19, 2022, 03:50:59 pm by gucao »
Please give me more patience with my poor English

 

TinyPortal © 2005-2018