1701805 - How to use the shared variable from an earlier subreport in a Selection statement to a later sub-report

SAP Knowledge Base Article - Public

1701805 - How to use the shared variable from an earlier subreport in a Selection statement to a later sub-report

Symptom

How to use the shared variable from an earlier sub-report in a Selection statement to a later sub-report

Environment

Crystal Reports 2008

Reproducing the Issue

Create a Report with multiple Sub Reports

Cause

Shared variables are executed at a later stage of Crystal Reports processing and hence they are not available for Record Selection.

Resolution

  1. Need to pass shared variable as a Parameter to the 'later sub-report'. This parameter can then be used in the select expert
  2. create a formula in the Main-Report and capture the value of the sub-report by creating Shared variable
  3. Place this formula and any formula that returns the SharedVar after the sub-report (perhaps, in a section that is below the sub-report that is returning this value)
  4. Make sure this formula shows the correct value in the Main report too
  5. Then right-click the second sub-report -> To which you want to pass this shared variable in select statement and use sub-report linking to link the Main report with second sub-report.

Keywords

Pass shared variable to next level, pass shared variable to next level of sub-report, crystal reports , KBA , BI-RA-CR-DSL , Crystal Reports on C++ Data Semantic Layer (ClassicUniverse) , How To

Product

Crystal Reports 2008 V1