SAP Knowledge Base Article - Public

2511614 - How to eliminate an empty Group Header at the top of the report in Crystal Reports?

Symptom

  • Empty Group Header.
  • First instance of a group is blank.
  • Duplicate Group Header displays at the top of the page.
  • How to eliminate an empty Group Header at the top of the report in Crystal Reports?

Environment

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

Reproducing the Issue

  1. In Crystal Reports designer, create a report off any data source.
  2. Add a group based on a string field.
  3. Refresh the report.
  4. Notice the top Group is empty.

Cause

  • There is an empty or NULL value in the data source for the field the group is created on.
     
    For example:
     
    If we create a group on a Country field, and in the database there is the following data.
     
       Country:
        - USA
        - Canada
        - <empty string>
        - Mexico
     
    And viewing the report, it will create will create a group with all of the above values, including the record where there is an empty string. And by default the group are sorted in ascending order, and an empty value comes first. This is why there is a blank group.

Resolution

  • To avoid displaying a blank group, filter the empty or null values for the field you are grouping by, out of the report. To do so:
       
    1. Open the report in Crystal Reports designer.
       
    2. Under the menu "Report", select "Selection Formulas - Record..."
       
    3. In the Formula Workshop window, add a records selection formula to filter out the empty string and NULL values of the field you have created a group on.
        
      For example, the formula will look like:
         
           Not isNull({grouping_field}) or Not ({grouping_field} = "" )
        
      Where {Grouping_field} is the field name on which you created a group on the report.
          
         
    4. Save and close the Record Selection Formula.
       

Keywords

duplicate, blank GH1, , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016