HideZeros

BJLBJL Brussels, Belgium
edited 8:58PM in FastReport 4.0
I have a case, where I want not to print zeros (0.00).
The property HideZeroes has been set to true. However, I still get 0.00.
What else should be done to really hide zeros?

Thanks

BJL

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:58PM
    what version are you using, are you working with a memo or a cross tab?
    is the value a true 0 or a decimal like 0.0001 and memo's display format is set to 2 decimals?
  • BJLBJL Brussels, Belgium
    edited 8:58PM
    Hi Gordk,

    Version 4.4.47
    TfrxMemoView
    DisplayFormat:
    fkNumeric
    %2.2n
    DecimalSeparator ,

    Of course, it is always possible to test the value and make the Memo invisible, when 0.

    Regards

    BJL
  • BJLBJL Brussels, Belgium
    edited 8:58PM
    I found the problem.
    It was due to the use if the function f_if in an SQL-request. Adding a cast solves the problem.
    Like

    cast(f_if(L.DC,'>',0,L.montant, 0) as NUMERIC(15,2)) as MTD

    BJL
  • gordkgordk St.Catherines On. Canada.
    edited 8:58PM
    Glad to hear you found it
    yes it is a usual problem with currency values even though display prop is 2 decimals
    the underlying value holds at least 4 places so depending upon calculations (usually taxes) a stored value may actually be 0.0010 or more decimals depending upon the precision the dbengine uses for currency fields.
  • BJLBJL Brussels, Belgium
    edited 8:58PM
    Gordk,

    In my case, it was a true 0. But the function f_if returns a string, well recognized by Fastreport under the format fkNumeric. But the Hidezero does not work if the value is a string. So the cast is necessary.

    BJL

Leave a Comment