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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is the order formulas are placed on report IMP?? 1

Status
Not open for further replies.

addy80

Programmer
Apr 15, 2002
12
SG
Hi everyone

i wanted to know if the order of placing the formulas on a report affects the output.
 
Yes, they evaluated left to right, top down. If evaluation order is important, use EvaluateAfter({field})
 
This is true, but only if the formulas share a global or shared variable. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
If you mean the sequence in which the formulas are placed on the report, then there is no impact. If you mean the position on the report, then location (actually the top left corner of the formula object) determines priority. And unless the formulas share information (as Ken pointed out, through Global or Shared variables), you won't know which gets figured first.
Evaluation time can also cause a few tripups, so make sure you are comfortable with that topic Andrew pointed out. Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
Malcolm, I am not sure I agree. At least I get a different result. To me, if you have two formulas sharing a variable, both while printing, and they are in the same section, then they are evaluated in the order they are added, not by position.

I created the following 2 formulas:

@assign:
WhilePrintingRecords;
NumberVar Test := {Customer.Last Year's Sales}

@Display:
WhilePrintingRecords;
NumberVar Test

I put both on details. If I put assign on first, followed by display, they show the same value. if I put display on first they are off by one record. Doesn't matter what position they are in. Am I missing something? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
No, I stand corrected Ken, at least for current versions of the product. The last time I really had to get into this was before v5, and on reflection I think the evaluation order must have changed with the incorporation of sub sections in CR.
I was curious about how you could determine the order in which formulas were added to a section. The report definition lists the formulas in the order they are added to the report, for each section. So I guess you could check the order there, if you were truly interested.
Thanks (again) for your corrections, Ken. Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
You simply move the formulas to another section, refresh the report, and then move them back to the original section. After that point I don't think you can tell, other than by behavior with variables. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top