SAP Knowledge Base Article - Public

1541065 - Variable value reset to zero in Crystal Reports

Symptom

  • Variable lose its value
  • Variable value reset to zero
  • When paging through a report in Crystal Reports, the variable reset to zero, despite there is no formula that is set to reset its value.

Environment

  • Crystal Reports 2008

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.                                                                           
  2. Create a formula in whhich you declare a variable and assign a value to it.  ( Variable – Assign Value )

WhilePrintingRecords;

NumberVar test := 777                                                                                                       

  1. Create a formula to display the variable. (  Variable - Display  )

WhilePrintingRecords;    

NumberVar test                                                                                                                                          

  1. Create a formula with a second variable. ( Variable - Calculation  )     

Whileprintingrecords;     

NumbervVar x:=x+1                                                                                                                    

  1. Add 2 extra subsections to the Report Header  section                             
  2. Insert the formulas in the following sections:
    • “Variable – Assign Value” in the “Report Header –a” section      
    • “Variable – Display” in the “Report Header – b” section      
    • “Variable – Display” again in the “Report Header – c”, and in the “Report Footer” section  
    • “Variable – Calculation” in the “Page Footer” section  
  3. Resize the Report Header A, B and to fill the first page so the Report Header C starts at the next page                                           
  4. Preview the report and notice the variable value on page 2 is NULL, and the variable value equal zero in the Report Footer section.

Cause

  • Variables are reset to zero when the Report Header is larger than a page, and there is a formula with a second variable in the Page Footer section.
  • The issue has been identified and logged under Problem Report ID ADAPT01464111

Resolution

  • The issue has been resolved in the following Crystal Reports 2008 updates:
    • Fix Pack 2.10 and higher
    • Fix Pack 3.3  and higher

Keywords

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

Product

Crystal Reports 2008 V0 ; Crystal Reports 2008 V1