SAP Knowledge Base Article - Public

1218704 - How to use a parameter to suppress or show a drill-down group in Crystal Reports?

Symptom

  • How to suppress groups when drilling-down based on a parameter value?
  • How to use a parameter value to conditionally suppress, or show, all drill-down groups in Crystal Reports?

Environment

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

Resolution

  • To suppress or show all drill-down groups based on a value entered in a parameter when refreshing a report, use the function: DrillDownGroupLevel
       
  • The function: DrillDownGroupLevel, returns the drill-down level.

    For example:

    On a report with multiple groups. When viewing a report in Preview mode, the function: DrillDownGroupLevel, returns the value: 0
    When you drill-down on the first group, the function returns the value: 1
    When you drill-down on the second group level, the function returns the value: 2
       
  • Based on the values returned by the function: 'DrillDownGroupLevel', create a conditional suppression formula in the Group Headers.

For Example:

  1. In Crystal Reports, create a report and insert multiple groups.
    In this example let's add 3 groups: State, City, and Store Name, and one summary: Sales Revenue
      
  2. Create a boolean prompt called: DrillDownEnabled
       
  3. Format the Group Header #2 and add the following formula to the Suppress option:

         If {?DrillDownEnabled} = True Then
         If DrillDownGroupLevel > 0 Then False
         Else True
       
  4. Format the Details section and add the following formula to the Suppress option:

         If {?DrillDownEnabled} = True Then
         If DrillDownGroupLevel > 1 Then False
         Else True
       
  5. Refresh the report, and select True or False for the Parameter value:
    • If you select: False, it will displays all the Groups at each level.
    • If you select: True, it will only show the Group #1, and click on the group to drill-down to the next group level.

 

Media not computed.

See Also

For more information on the 'DrillDownGroupLevel' function and conditional formatting, refer to the Crystal Reports Online Help by pressing the F1 key.

Keywords

CR, Parameter, Conditional Suppress, Drill-down, Hidden, Crystal, Reports, Groups, Parameters, CRE, CR4Ent, DrillDownGroupLevel , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , BI-RA-CRE , Crystal Reports for Enterprise , How To

Product

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