SAP Knowledge Base Article - Public

1535232 - Shared variable returning zero values in crystal reports

Symptom

  • Result of calculated values passed from subreport to the main report and vice versa is shown as zero in Crystal Reports.

Environment

  • Crystal Reports 2008

Reproducing the Issue

  1.  Create a Crystal report using Xtereme Sample Database . 
  2.  Insert a Subreport in Page Header. 
  3.  Create a Formula to calculate any value (for e.g. sum of all Last Year Sales from Customer Table) and scope of that variable should be Shared. 
  4.  Create a Formula in main report to call the Shared Variable from Subreport. 
  5.  Place the Formula in Report Header section. 
  6.  Suppress the Subreport. 
  7.  Refresh the report.

Cause

Subreport is Suppressed or Formulae are placed in a section above the section in which Subreport is placed in main report.

Resolution

  1. When passing calculated values from Subreport to main report, place that Formula in the Subreport.
  2. In Main Report place that Formula in a section below where Subreport is placed.

Keywords

Subreport , zero, main report, displaying, Crystal report , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 10.0 ; SAP Crystal Reports XI R2