SAP Knowledge Base Article - Public

1939502 - How to avoid zero value returned by formula to display line in Crystal Report

Symptom

  • How to avoid the zero value returned by formula to create a line in Crystal Report
  • Trend line of line chart doesn't stop on point "0"

Environment

  • Crystal Report 2008
  • Crystal Report 2011

Reproducing the Issue

  1. Create a line chart which displays a value coming from a variable like " if ({testcr_query.Flag} = "YES") then ({testcr_query.Sum})".
    ***As the Flag for month 4, 5, 6 is "NO", so the value for this 3 months is "0".***

  2. If the data is coming from Database not formula, then the line breaks on Month 3 which is different with value from formula.
    => Customer expects the line can stop on Month 3 when displaying value from formula as well.

Cause

This is product design.

Resolution

Workaround:

***This is just a workaround to make 0 be out of displaying scope, not works when the value include a negative value***

  1. Select an item on the y axis of the chart, then right click.
  2. In the contextual menu, select "Data (y) axis Options...".
  3. In the "Data (Y) Axis Settings" window, under the tab "Scales".
    - Set the Minimum Value to 0.1
    - Check the option "Don't Draw Out of Scale Values"
  4. Click "OK".

Keywords

cr2008, cr2011, cr, graph, line, chart, formula filed, function, zero, null, report option, convert null value to default , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011, feature pack 03