Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Zero instead of blank

Status
Not open for further replies.

WarrenTheWindmill

Programmer
Sep 8, 2000
18
GB
I'm sure the answer to this is simple but I can't find it.

I have a field in my report which displays a blank if the database value is zero.

Is there an option to get this to display the number 0 rather than the blank?

Thanks in advance
 
If the field is truly zero (and not a null) then it should display the zero by default. There is a formatting option to print blank instead of zero, but someone would have to activate it. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hi Ken

I am using the default format for the field. If I use the customise option to show zero values as 0, it makes no difference, it still displays a blank.

I definitely have a zero, rather than a null, in my (Oracle) database, and I am using CR8.5

I'm still puzzled as to why I cannot get this to work.
 
Why dont you put a Formula Field instead of the Field itself. And in the formula check if the value is Blank ..iF yes display a Zero.

I Hope it helps!
 
That is a strange behavior. Here is a test that might tell us what is going on. It will also help if we need the if-then to do this:

Write three simple formulas using this field, and place them on the detail band:

1) {field} // the field by itself
and
2) {Field} = 0
and
3) IsNull ( {Field} )

Now preview and tell us what each of these prints on your report on a record that is a zero in the database. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top