SAP Knowledge Base Article - Public

2919029 - Error: 'There must be a group that matches this field.' or 'This group selection cannot be printed...' when refreshing a report in Crystal Reports

Symptom

  • Report fails to refresh.
  • Error: There must be a group that matches this field. 
  • When refreshing a report that contain a group in Crystal Reports, it fails with one of the following error:

      "There must be a group that matches this field."

          OR
         
      "This group selection cannot be printed because it's field is nonexistent or invalid. Format the selection to choose another condition field."

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020 

Reproducing the Issue

  1. In Crystal Reports, open a report.
  2. Refresh the report.   
      
    It then fails with the error: 'There must be a group that matches this field.'  

Cause

  • The report have at least one formula using an aggregate function like: SUM, AVERAGE,... based on a group that does not exist on the report, because:
    • The group was never added on the report; or
    • The group was changed or removed by the person designing the report after creating the formula; or
    • The database field used to group by, no longer exist in the database.

Resolution

  • To refresh the report successfully, add, or update the group on the report, to use the same database field used for the group in the formula:
      
    1. In Crystal Reports, open the report.
        
    2. Refresh the report. 
        
    3. When the error display, it will show the formula code where the error occurs. In the formula, take note of the database field it is using to group on.

      For example: If the error occurs in the following formual:

          SUM({Database Field 01},{Database Field 02})

      The formula above use the aggregate function: SUM,
      to summarize the first field: {Database Field 01}
      for each group, which is identified by the second field: {Database Field 02}
      Therefore the field to take note for the group, is the second field of an aggregate function.
           
    4. Exit the formula.
          
    5. Under the menu "Report", select "Group Expert"
        
    6. Add or update a group on the report to use the same database field, as the grouping field used in the formula.
          
    7. Click "OK" to accept the change.
           
          
  • Note: In the scenario, where the database field no longer exist in the database, then either ask the database administrator to re-add the database field, if possible, or find a database field to group the report, and update the formulas.

Keywords

CR, GRP , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020