How to display blank instead of 0.00 for numbers

rhardoyalrhardoyal Member Posts: 78
edited 2011-08-05 in NAV Three Tier
Hi,

I have a field that is displaying value in the format 50,678.78
i have used the FormatNumber(fields, 2) and it is giving me the above result correctly when the dataset is not blank or 0
However, at times I am getting the value displayed as 0.00 where there is no value. I want this to be blank. What should i use?
Note that when I use Code.blankzero(formatNumber(fields!number,2)), this gives me an error on the report.

Any help on this please.

Thanks,
Rizwana

Answers

  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    rhardoyal wrote:
    Hi,

    I have a field that is displaying value in the format 50,678.78
    i have used the FormatNumber(fields, 2) and it is giving me the above result correctly when the dataset is not blank or 0
    However, at times I am getting the value displayed as 0.00 where there is no value. I want this to be blank. What should i use?
    Note that when I use Code.blankzero(formatNumber(fields!number,2)), this gives me an error on the report.

    Any help on this please.

    Thanks,
    Rizwana

    something like this doesn't work for you?
    Visibility property:
    =iif(IsNothing(Fields!decimalField.Value),true,false)
    
    ~Rik~
    It works as expected... More or Less...
  • Sergii_ChernenkoSergii_Chernenko Member Posts: 14
    Or something like the following:

    Value property
    =Iif(Fields!decimalField.Value <> 0,Fields!decimalField.Value," ")
    
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Or something like the following:

    Value property
    =Iif(Fields!decimalField.Value <> 0,Fields!decimalField.Value," ")
    

    =D> good solution is better than mine!
    ~Rik~
    It works as expected... More or Less...
  • julkifli33julkifli33 Member Posts: 1,092
    use this?
    Code.BlankZero(Fields!decimalField.Value)
    
  • dave_cdave_c Member Posts: 46
    rhardoyal wrote:
    Note that when I use Code.blankzero(formatNumber(fields!number,2)), this gives me an error on the report.
    You may need to add the blankzero function to to the code for the report on the code tab of the report properties dialogue. What's the error that you get?
Sign In or Register to comment.