Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CR2011: Shared Variables

Hi everybody

I often use shared variables in Crystal Reports 2011, and never had any problems.

This time, I got stuck ... don't know why.

I have a Main report and 2 subreports S1, and S2

I want to pass a shared variable from S1 to S2

So, I create the shared variable (SeriousErrors_sv ) in each of Main, S1, and S2.

I copy and paste the formulas so that you see exactly what I typed, and spot my error

In S1:



Shared NumberVar SeriousErrors_sv;

SeriousErrors_sv:= {usp_2014_101.Er5_TotalNoOfEr};


In S2


Shared NumberVar SeriousErrors_sv;


In Main:



Shared NumberVar SeriousErrors_sv;


I have placed each shared variable in the respective report.

S1 ---> Reads 9 (Correct)

S2 ---->Reads 0 (Bad)

Main ----> Reads 0 (Bad)


It seems that S1 is not passing the SV to Main.

What could have gone wrong?


Leon Lai


With an on-demand Subreport, shared variables will only evaluate when the subreport is clicked on.

Only other workaround is to place another copy of the same subreport that is only used to make the shared variables work.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question