Ads Top

Manual Conditional Calculations in Crystal Reports

'Manual Conditional Calculations in Crystal Reports
'Ruining totals are very easy but some time you may need to calculate manually, here the code for that
'Create Three Formulas form1, form2 and form3
'Keep Form1 on Report header, Form2 on your section and Form3 on report footer
'Add below code to your formulas
'Form1
WhilePrintingRecords;
numberVar gtotbasedon:= 0;

'Form2
WhilePrintingRecords;
numberVar gtotbasedon;
if {YOUR.FIELD}= YOUR_CONDITION then
gtotbasedon := gtotbasedon + {YOUR.FIELD}
else
gtotbasedon := gtotbasedon;

'Form3
WhilePrintingRecords;
numberVar gtotbasedon;
gtotbasedon := gtotbasedon

'end source code
'
Code by Kiran Reddy

Fullnotes: Visit here for more details

No comments:

Powered by Blogger.