Crystal Reports  

Shared Variables (Basic Syntax)

Shared variables use the same memory block to store the value of a variable throughout the main report and all of its subreports. Thus shared variables are even more general than global variables. To use a shared variable, declare it in a formula in the main report as in the following example:

Shared x As Number
x = 1000

and declare it in a formula in the subreport as in the following example:

Shared x as Number

To use shared variables, the variable must be declared and assigned a value before it can be passed between the main report and the subreport.

See Also

Global Variables | Inserting Subreports