Link to home
Start Free TrialLog in
Avatar of Prashant Vasha
Prashant VashaFlag for India

asked on

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
Avatar of ksivananth
ksivananth
Flag of United States of America image

you may write a function in the DB to do the conversion!
Avatar of Prashant Vasha

ASKER

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
my suggestions won't work if you don't have control over SQL query, especially the select field list part!
Yeah, we are using the crystal report designer, where we drag the columns required from the tables into the report directly.

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
ASKER CERTIFIED SOLUTION
Avatar of HugoHiasl
HugoHiasl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or set the formula editor to 'Defaults for nulls' instead of 'Exceptions for nulls' and use the formula

0+{YourDBField}
We did a null check in a formula and displayed the result of the formula.