Search code examples
c#reportviewer

Report Viewer - convert any 0 value to display blank or null value


How do I make any 0 value display blank or null? Can I do a condition expression in report viewer perhaps

Update: here is what I have tried

=IIf(FormatNumber(Fields!totalnetamaount.Value, 2) is 0, "", FormatNumber(Fields!totalnetamaount.Value, 2))

It threw the exception

Error 1 The Value expression for the textrun ‘totalnetamaount.Paragraphs[0].TextRuns[0]’ contains an error: [BC30020] 'Is' operator does not accept operands of type 'Integer'. Operands must be reference or nullable types.


Solution

  • Replace your "is" with "=". Modify your condition as follows,

    =IIf(FormatNumber(Fields!totalnetamaount.Value, 2)=0, "", FormatNumber(Fields!totalnetamaount.Value, 2))