SAP Knowledge Base Article - Public

1278363 - Cross tabs gives “Division by zero” error.

Symptom

  • The crosstab table contains a formula: "WhilePrintingRecords" which works fine when the crosstab fits in one page.
  • When the table rolls over to the next page, get the error "Division by error"

Reproducing the Issue

Product: Crystal Reports XI R2.
Operating System: Microsoft Windows XP.

Resolution

  1. When using the formula in the Cross tab in the Summary data and using the formula in the Display String of the Format Editor, gives the error "Division by zero"

      WhilePrintingRecords;
      numberVar k;
      totext((CurrentFieldValue/k)*100)+"%"

  2. Since the variable is not initialized in the formula, we need to initialized so that the Division by zero error is eliminated.
  3. In the above formula we have to assign 1 to the variable k - numberVar k := 1;

Keywords

Cross Tab. , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , How To

Product

Crystal Reports 2008 V0 ; SAP Crystal Reports XI ; SAP Crystal Reports XI R2