Solved

Display default value for null columns in crystal report

Posted on 2010-08-16
8
786 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
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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now