HideZeros

BJLBJL Brussels, Belgium
edited 12:06PM 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 12:06PM
    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 12:06PM
    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 12:06PM
    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 12:06PM
    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 12:06PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.