SAP Knowledge Base Article - Public

1504413 - The evaluation sequence of shared variable in two subreports of one report section in Crystal Reports

Symptom

  • The shared variable in 2 subreports that were put in one section is not valuated from left to right
  • It is evaluated by the sequence of creation of subreports

Environment

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

Reproducing the Issue

  1. Create 2 subreports, which use one shared variable.
  2. Put the 2 subreports into one section (eg. Page Header)
    1. - See the attached CR report.

Cause

  • The shared variables are not evaluated "left-to-right" or "right-to-left" but rather in the order they were created in that section.
  • The shared variable in the subreport that was firstly created will be evaluated first, and then the shared variable in the secondly created subreport and so on.

Resolution

If you need to change the evaluation order of your shared variables, youd don't need to recreate everything, instead you can move the subreport to a different section of the report, and then move it back to the corresponding report section.

Keywords

function, field, formula, order, calculation , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports XI R2

Attachments

Report_2Sub.rpt