Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in formula field of crystal reports when no records found

I am working on crystal reports. I want to show the sum of the record on footer of every page. so I have added the formula field in crystal reports which have below formula.

whileprintingrecords;
numbervar PageTotl;

if isNULL({Customer.PaidAmount})Then 
0
else
PageTotl:=PageTotl + {Customer.PaidAmount}

its gives error below when there are no records present with given criteria.

enter image description here

What kind of changes I have to made in above code, so it can also handle the 0 records.

like image 282
bnil Avatar asked Nov 29 '16 19:11

bnil


1 Answers

First, I got the same error, After fixing the formula to the following one, no errors came out:

whileprintingrecords;
numbervar PageTotl;

if isNULL({Customer.PaidAmount})Then 
0
else
PageTotl:=PageTotl + ToNumber({Customer.PaidAmount})
like image 82
Zeina Avatar answered Sep 23 '22 06:09

Zeina