Solved

Display default value for null columns in crystal report

Posted on 2010-08-16
8
790 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:pvasha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 33452200
you may write a function in the DB to do the conversion!
0
 

Author Comment

by:pvasha
ID: 33452220
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
 
LVL 26

Expert Comment

by:ksivananth
ID: 33452235
my suggestions won't work if you don't have control over SQL query, especially the select field list part!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:pvasha
ID: 33452251
Yeah, we are using the crystal report designer, where we drag the columns required from the tables into the report directly.
0
 
LVL 8

Expert Comment

by:kingjely
ID: 33452269

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
 
LVL 12

Accepted Solution

by:
HugoHiasl earned 250 total points
ID: 33452285
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
 
LVL 13

Expert Comment

by:PCIIain
ID: 33452453
Or set the formula editor to 'Defaults for nulls' instead of 'Exceptions for nulls' and use the formula

0+{YourDBField}
0
 

Author Closing Comment

by:pvasha
ID: 33463569
We did a null check in a formula and displayed the result of the formula.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question