Prashant Vasha
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
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
you may write a function in the DB to do the conversion!
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
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!
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or set the formula editor to 'Defaults for nulls' instead of 'Exceptions for nulls' and use the formula
0+{YourDBField}
0+{YourDBField}
ASKER
We did a null check in a formula and displayed the result of the formula.