Crystal Reports for Eclipse Designer Guide

To create a conditional running total

  1. Create a report using the Customer table from the Xtreme sample database.
  2. Select the CUSTOMER_NAME, Country, and LAST_YEARS_SALES fields from the Customer table, and place them in the Body section.
  3. On the Crystal Reports menu, click Record Sorting.
  4. In the Record Sorting dialog box, sort the records based on the {CUSTOMER.CUSTOMER_NAME} field.
  5. In the "Field Explorer" view, right-click Running Totals, and click New.
  6. Select the new running total.
    The running total settings are displayed in the "Properties" view.
  7. In the "Properties" view, in the Name box, type the name "USTotal".
  8. From the Summarized Field list, select {CUSTOMER.LAST_YEARS_SALES}.
  9. From the Summary Operation list, select Sum.
  10. From the Evaluate Condition Type list, click Use Formula.
  11. Double-click Evaluate Condition.
    The running total formula is displayed on the Formulas tab.
  12. Under USTotal, type the following formula:
    {CUSTOMER.Country} = "USA"
    
    This tells the program to evaluate the running total each time it comes to a record where {CUSTOMER.COUNTRY} is equal to "USA." The running total will ignore all other records (such as records for Canada).
  13. From the Reset Condition Type list, select Never.
  14. Select the Layout tab, and place the running total field in the Body section of your report.
  15. Now create the "CanadaTotal" running total field using the process outlined in steps 5-13, but this time you will set the following evaluation formula:
    {CUSTOMER.Country} = "Canada"
    
  16. When you are finished, place the #CanadaTotal field in the Body section of your report.

    Note: If you only want to see a grand total of the Canadian and American sales, place the two running total fields you created in the Report Footer section of your report.



SAP BusinessObjects
http://www.sap.com/sapbusinessobjects/
Support services
http://service.sap.com/bosap-support/
Product Documentation on the Web
http://help.sap.com/