Home Datapipelines
New Blog Posts: Merging Reports - Part 1 and Part 2

DBCalc not summing JIT value that is BCD

I have a variant that contains a BCD value from a query that will not sum. The DBText will display each value but the Sum always returns 0. I am on 20.01

To reproduce you can do this. Create a JIT field with type Extended (no BCD option). An use this to generate values:

function TForm1.JITGetFieldValue(aFieldName: string): Variant;
begin
Result := VarFmtBcdCreate(10);
end;

Comments

  • Hi James,

    The Delphi unit Data.FMTBcd contains some conversion functions: BcdToDouble, BcdToCurr

    uses
    Data.FMTBcd;

    function TForm1.ppJITPipeline1GetFieldValue(aFieldName: string): Variant;
    begin
    Result := BcdToDouble(10);
    end;

    For comparison, the RB DBPipeline converts TFieldType ftBcd and ftFMTBcd to TppField.DataType dtDouble. And when retrieving the value calls TField.AsFloat.




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • The TppDbText component handles this variant without conversion. Why wouldn't the Calc do the same? I have hundreds of reports to convert.
Sign In or Register to comment.