Hi Guys,
I am confused on How to get the Total for a Decimal Variable in the Report. For Example I have created a Decimal Variable call DecimalVariable.
DecimalVariable := A + B ;
How to get the Total of that DecimalVariable from the Report? Plz help on this.
Thanks in advance.
0
Comments
1st A+B = 20
2nd A+B = 35
3rd A+B = 40
4th A+B = 72
5th A+B = 50
Here I have 5 records.
So I have print that Total as 20 + 35 + 40 + 72 + 50 = 217. This is what I am asking. HOw to get the Total?
Sum (text)
Make a field called: Total (decimal):= 1st+2nd+3rd+4th +5th;
or
Sum := "%1 + %2 + %3 + %4 +%5 = %6", 1st, 2nd, 3rd, 4th, 5th, Total ;
I havent tested it, but it should be something around those lines.
create a global variable (in this case DecVar) of type decimal. In the appropriate DataItem, place code in the OnAfterGetRecord section like:
DecVar:= 0;
DecVar := DecVar + SalesInvLine.Amount;
Then use DecVar as your SourceExpr in the textbox. You probably don't want to add processing type code in the sections area of your report. Run your report through the debugger so you can get an idea of how the calculations work for you. Good luck with this.