Click here to Skip to main content
15,916,180 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi..

I cam across this problem and need a solution.

I have a crystal report which generates a bill..
In the bill it includes the amount for the item and the charges that applies to the amount.

If the charges have description "ADD" , it must be added to the item total and if it has description "LESS" it should be deducted from item total and final amount should be displayed as total.

The report displays all the data, I tried to take a variable named total and on its field explorer i wrote this..

int _total;
if({Expensedetail.add_less}='add')
{
_total=_total+{Expensedetail.Amount};
}
else
{
_total=_total-{Expensedetail.Amount};
}



this is not working...can you guys please suggest me what to do??
Posted

1 solution

Have you written this code in the formula editor? Does it save without any errors?

I think you will need to read up on what "WhilePrintingRecords" does...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900