i can't show space in formula in Crystal Report

175 Views Asked by At

I use this code to show the sum of my bank

if {?Bank} = {Bank.sum} then {#1} else 0

I have 6 bank accounts and when the bank = Bank has operations, then I show the sumand else I do not show anything.

I do not want to show "0" in my report.
I want to show " "(space), but when I change it to " ".

When I do it, I get the error

A number is required here

How can I fix it?

enter image description here

2

There are 2 best solutions below

0
On

In that case, use:

if {?Bank} = {Bank.sum} then ToText({#1},0) else ""

The 2nd arg indicates zero decimal points. See online documentation of the ToText() function.

1
On

One option:

if {?Bank} = {Bank.sum} then ToText({#1}) else ""

Another option is to use formatting.