Solved

Display default value for null columns in crystal report

Posted on 2010-08-16
8
791 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

751 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