Crystal Reports-How to display nulls as zero

Posted on 2009-05-01
Last Modified: 2013-11-15
Here's another one for the Crystal gurus.  I am not really familiar with using formulas on the "Format field" page.  I have the following issue:

I am performing a summary on a detail record amount field , displaying the summary field on the report.  For some reason, if there are no detail records or the amount fields are null, the summary shows up on the report as blanks (or null?).   I have the selector set to "show zero value as 0."  However, i don't know how to get it to show a blank or null value as zero (which is a requirement.
help!  thanks
Question by:mbroad02
    LVL 1

    Expert Comment

    You can display null values as zero by implementing the following formula:

    if (isnull({yourNumberField})) then
    LVL 100

    Accepted Solution

    If you mean the summary field, I don't think you can.  You can however use the formula above and then summarize that one and get the 0 to display.


    Author Comment

    I appreciate your suggestions.  However when I use the formula:

    Global currencyVar AMT_TOT;if (isnull(AMT_TOT)) then0elseAMT_TOT;

    I get an error saying "A field is required here" for the AMT_TOT right after the isnull.

    What am I doing wrong?
    LVL 100

    Expert Comment

    A variable cannot be NULL, you can only test database fields with IsNull.


    Expert Comment

    go to report options in the file menu and check the 'set database values to default'

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    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…
    Hi, In my previous Article  ( discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    734 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

    18 Experts available now in Live!

    Get 1:1 Help Now