Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: IF then statement in crystal report

$
0
0

Hi Farhan,

 

To use the value of a variable, you need to declare that variable in every new formula you create.

 

Depending on when the formula evaluates (whileprintingrecords, whilereadingrecords) CR 'remembers' the last value of the formula.

 

That's why FormulaTwo above shows 25 since 'x' was already initialized to 10 in some other formula(that evaluates at the same time as this formula).

 

So, in FormulaTwo x := x + 15 becomes:

x := 10 +15

..and in a way 'x' is now re-initialized to 25.

 

You really don't need a separate 'Initialization' formula if you know what you're doing. 'Initialization' and 'Evaluation' can be done in the same formula.

 

P.S: In a real world scenario, very rarely would you create a variable initialized to something greater than 1!

 

-Abhilash


Viewing all articles
Browse latest Browse all 9069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>