Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Summing up a summarized field Post Reply Post New Topic
Author Message
vaibhav123
Newbie
Newbie
Avatar

Joined: 03 Nov 2009
Online Status: Offline
Posts: 19
Quote vaibhav123 Replybullet Topic: Summing up a summarized field
    Posted: 28 Jan 2010 at 5:32am
Hello,

I have a summary field which is basically a count on one of the data fields. So, my report looks like this:

Name       Numbers
A                 10
B                15
C                 10

The numbers above are a count of some field in the database. Now, what I am trying to achieve is get the sum of these numbers i.e. somehow get 35 as the grand total. I tried using a simple formula, but got a message that " summary field can not be summarized"

I was wondering if there is a way to get the desired total in this case. Any help is highly appreciated.


-V
IP IP Logged
arnold
Newbie
Newbie


Joined: 27 Jan 2010
Online Status: Offline
Posts: 3
Quote arnold Replybullet Posted: 29 Jan 2010 at 2:07am
hi,

try to set the formula in the range that prints every line of your data like this_:

___________________________
formulat that initiates the var
___________________________
---------------------------
Name numbers   formula2
---------------------------

The variables for that must be initiated sowhere in the Head like this:
shared numbervar varyourvarname:=0;

then you use another formula, in this case formula2 like this:

shared numbervar varyourvarname;
varyourvarname:=varyourvarname+your summary field

What ist does:
in the head the var is set to zero.
It then comes to the first detailrange and adds your first summaryfield to the var, in this case your var is 10.
then it advances to the second detailrange/data and adds again 15, so the var has now a value of 25.
and so on.
At the end you should have a value of the var that is 35 as expected. Now you can show this var everywhere in your report with a formula like this:
shared numbervar varyourvarname;

the formula that adds the values of the summary field can be suppressed without any criteria, because it is executed anyway.


Another way to solve that problem could be:
you summarize with a formula instead of using a sum field and then you can summarize over that formula to get your sum in the end.

hope this help

kind regard
Markus
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.031 seconds.