Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Global Variable in CR 7.0

Status
Not open for further replies.

joobi

Programmer
May 4, 2003
6
0
0
AE
Can anybody explain me how to use a global variable.
 
All variables are global by default unless you declare them to be local or shared.

If you give me an idea of what you want to accomplish with your variable, I can answer the rest of your question better.


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
I have two groups in my report. All I need to display is total of the first group in the second group.
The value in the first group is not a summary field. It's a formula field. Hence I am not able to use running total.
Please Help.
 
Just assign the result of your calculation to a variable...as pointed out they are global by default.

NumberVar Total;
Total := [whatever you are summing]

Your formula may already contain this variable

in the second group just do this

@DisplayTotal

WhilePrintingRecords;
NumberVar Total;

Total; // or "This is the total: " + ToText(Total,2)



Jim Broadbent
 
The thing most people miss out is to assign an evalaution time to the formuala. Global variables are by default "WhileReading Records" but seem to work a lot better if they are calculated later (WhilePringRecords).

Insert...
WhilePrintingRecords;

at the start of all your formulas. And they might work a bit better.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top