Display default value for null columns in crystal report

Hello,

We are using crystal reports to generate some PDF reports. One of the reports requires us to display a 0 [zero] in case the database column is null. This values are either returned from the database columns or calculated from formulas in sub reports.
Is there some kind of a property that needs to be set so that 0 is displayed in place of null values.
We are using the crystal report plug in for eclipse.

Thanks for your support

Best  Regards,

Prashant
pvashaAsked:
Who is Participating?
 
HugoHiaslCommented:
I would propose to create a crystal formula and display this one.

It could contain something like

IF IsNull({YourDBField}) THEN
  0
ELSE
  {YourDBField}
0
 
ksivananthCommented:
you may write a function in the DB to do the conversion!
0
 
pvashaAuthor Commented:
We have not writen any SQL query to get the records for the report. We have just mentioned the where clause to retrieve the records.
ksivananth: Can you please elaborate your suggestion?

Thanks,

Prashant
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
ksivananthCommented:
my suggestions won't work if you don't have control over SQL query, especially the select field list part!
0
 
pvashaAuthor Commented:
Yeah, we are using the crystal report designer, where we drag the columns required from the tables into the report directly.
0
 
kingjelyCommented:

If you dont want to do it in the Database,

In crystals,
GO TO

File> Report Options> General settings> check> Convert Database NULL values to Default> (Default for numbers is 0)

Hope this helps,

Kj
0
 
PCIIainCommented:
Or set the formula editor to 'Defaults for nulls' instead of 'Exceptions for nulls' and use the formula

0+{YourDBField}
0
 
pvashaAuthor Commented:
We did a null check in a formula and displayed the result of the formula.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.