Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: I need Horizontal sum in Crystal repo Post Reply Post New Topic
Author Message
humillmca
Newbie
Newbie


Joined: 11 Aug 2010
Location: India
Online Status: Offline
Posts: 2
Quote humillmca Replybullet Topic: I need Horizontal sum in Crystal repo
    Posted: 11 Aug 2010 at 3:27pm

  Respected Sir/Mam,

     I am using Crystal report 9.2 and VB 6.0.

   I need horizontal sum of 9 fields.
   I havent any field in that i can store the sum of that 9 field.

Help me as soon as possible.

Thanking You,

Harshad Mahant
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 17 Aug 2010 at 4:58am
Create a formula.  If none of the fields can be null, it will have this type of syntax:
 
{field1} + {field2} + {field3} + ...etc.
 
If any of the fields can be null, then you'll have to do something like this:
WhilePrintingRecords;
Numbervar mySum;
If not IsNull({field1}) then mySum := {field1} else mySum := 0;
If not IsNull({field2}) then mySum := mySum + {field2};
If not IsNull({field3}) then mySum := mySum + {field3};
...(add the rest of the fields)...
If not IsNull({field9} then mySum := mySum + {field9};
mySum
It's important that you have the final "mySum" without the semi-colon at the end or else the number won't display.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.