SAP Knowledge Base Article - Public

1575461 - How to eliminate on a bar chart, the bar that have null values in Crystal Reports?

Symptom

  • How to eliminate the bars having null values on a chart?
  • How to only show bars which have values on the x-axis of a chart in Crystal Reports?
      
       
  • Note: Images and data in this SAP Knowledge Base Article is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any relational data source.
  2. Insert a Bar Chart on the report.
  3. Notice one of the bar on the chart display count for NULL values. How to not show the NULL on the chart? 
      
    Bar Chart - 01.jpg

Resolution

  • To not display a bar for the row of data that is empty, eliminate the data of coming on the report adding a Record Selection Formula.
      
    1. In Crystal Reports, open the report on which you have the Bar Chart.
         
    2. Under the menu "Report", select "Formulas  - Record"
           
    3. Inthe Record Selection Formula Editor window, write a formula to filter the empty data of coming on the report, for the database field used on the chart. The formula will look like:
         
      If {Database Field Name} <> "" Then True     
        
      Note: {Database Field Name} is the name of the database field used on the a-axis of the Bar Chart.
           
    4. Click on "Save and close".
        
    5. Now the Bar Chart only shows the bars that have data only.
        
      Bar Chart - 02.jpg
         

Keywords

remove,ignore,null values ,empty series , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports all versions