SAP Knowledge Base Article - Public

2140630 - Formulas missing when creating an Alert Condition in Crystal Reports

Symptom

  • Formula missing.
  • Unable to see formulas when creating an Alert.
  • When creating a condition for an Alert in Crystal Reports, some of the report formulas are not listed.

Environment

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

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
  2. Create a formula that uses variables or running total fields.
  3. Save the formula. For example, name the formula "My Formula"
  4. Create a new Alert on the report, and notice the formula is not listed to be used in the Alert Condition.
    • Under the menu "Report", select "Alerts - Create or Modify Alerts..."
    • In the "Create Alerts" window, to create a new alert, click "New..."
    • In the "Create Alert" window, enter a name and a message for the alert.        
    • Click on the "Condition..." button
        
      Alert - 01.png   
         
    • Notice in the Formula Workshop, it does not list the formula created on the report.
        
      Alert - 02.png

Cause

  • Alerts condition can be created on summary, database fields, and parameters.
  • Alerts condition cannot be created on second pass formulas, like formulas that uses shared variables, running totals,... and this is why the formula are not displayed in the list of available objects to use for the Alert conditions.

Resolution

  • To workaround this limitation, add a subreport, and pass the value of the second pass formula the subreport parameter. This will make the value available in the first pass in the subreport, and therefore the value can then be used in an Alert in the subreport.
         
  • Below are the generall steps on how to apply this workaround:
          
    1. Add a subreport in the Report Footer section of the report.
           
    2. Base the subreport off a database with a table that returns only one record.
         
    3. In the subreport, create a parameter of the data type the formula on the main report output. ( Most likely a number )
          
    4. In the main report, link the main report to the subreport parameter, on the formula that output the value you wanted to base the Alert on.
           
    5. In the subreport, create an Alert, and base the condition on the value output by the subreport parameter.
      ( Which actually contains the main report formula result )
             
    6. Now, when refreshing the report, if the condition is met, it will display the Alert.
        
      The following sample report has been formatted using the above workaround:
      - Alert on Second Pass formula.rpt

Keywords

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

Product

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

Attachments

Alert on Second Pass Formula.rpt