Monday, May 26, 2008

Crystal Report Programming

Hi friends ,

Here Some work with crystal report programming


· To total a report field with a formula field

EvaluateAfter ({@DrOpBalance});
{@DrOpBalance} + Sum ({Debit});

Where @DrOpBalance is a formula field and Debit is a report field.

· Conditional statement

1)

EvaluateAfter ({@CrSideTotal});
If {@DrSideTotal} >= {@CrSideTotal} Then
{@DrSideTotal} - {@CrSideTotal}
Else
0.00;

2)

WhilePrintingRecords;
NumberVar DrTotal;

If {XMLRBSheet.AMOUNT} > 0 Then
DrTotal := DrTotal + {XMLRBSheet.AMOUNT};

If {XMLRBSheet.AMOUNT} > 0 Then
{XMLRBSheet.AMOUNT}
Else
0.00;

· Declaring variables

NumberVar DrTotal;

· Variable assignment

Dabit := 1000

· Accessing final/latest value of a variable

EvaluateAfter ({@ClStock});
NumberVar CrTotal;
NumberVar CurrentRecord;

CurrentRecord := RecordNumber();
CrTotal := CrTotal + {@ClStock};