Friday, March 6, 2009

Getting Previous Values of Formula Fields in Crystal Report


Suppose if I want to add balance of a previous record to next like below ,


Amount

Paid

Balance

1000

500

500

1250

1000

750 (500+250)

500

300

950 (750+200)



>> First create a formula field, say: tempBalance


In that write:
shared numberVar x:=0;
x:={@balance} //{@balance} is
formula filed which will calculate balance

In @balance write:
shared numberVar x;
{PaymentDetails.Total}-{
PaymentDetails.Paid} + x

//In @balance the variable x will get the previous value from @tempBalance . Only we have to declare here as
shared numberVar x;


No comments: