yahoo invisible

Saturday, January 24, 2009

Variable Types in crystal reports

There are 3 levels of scopes for variables in crystal reports.
1. Local
2.Global
3. Shared

Local Variables
Declaration: scope TypeVar variablename;
Ex: Local NumberVar x;

*this type of variable can be only used within that formula. Can't access from another formula.

Global Variables
Global variables can be accessed by any formula in the main report. but sub report formulas can't access.
* by default in crystal variables are global.
ex; Global StringVar y;

Shared Variables
Shared variables can be accessed in the main report and also in the sub reports.
Declare it in the main report.
Ex: Shared NumberVar x:=1000;
Before passing the shared variable to a sub report it should be declared and assigned a value as above.
use it in the sub report as follows

Shared NumberVar x;

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home