Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Running Total In Crystal report Post Reply Post New Topic
Author Message
j_tush
Newbie
Newbie
Avatar

Joined: 20 Oct 2009
Location: India
Online Status: Offline
Posts: 4
Quote j_tush Replybullet Topic: Running Total In Crystal report
     Posted: 20 Oct 2009 at 12:12am
Hi,

Need to summarize some fields in crystal reports but not able to do it. some fields those are not mentioned in detail section are not available in insert summary option. I need to do running total of all revenue and amount fields Can anyone help me.
Tushar Jindle
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Oct 2009 at 5:54am

I always use shared variables in formulas.  You can access any field and increment however you like. There is a bit more work, but I can get an answer.  I personally don't get running totals, but I have been using shared variables for years, it is second nature at this point.

 
DBlank uses running totals, so he will probably respond with useful suggestions.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 6:57am
Usually the reason that a field is not available for insert summary is because it is a formula field that already is using a summary function in it.
If you post specifics as to what the data is, how you have your report grouped and how you need the data summarized (example data helps) someone will be able to assist you.
IP IP Logged
j_tush
Newbie
Newbie
Avatar

Joined: 20 Oct 2009
Location: India
Online Status: Offline
Posts: 4
Quote j_tush Replybullet Posted: 20 Oct 2009 at 8:14am
can i have ur email id so i can send you report so you can get it properly
Tushar Jindle
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 8:30am
Sorry, I don't accept reports but post as best you can on the site and see what happens.
IP IP Logged
j_tush
Newbie
Newbie
Avatar

Joined: 20 Oct 2009
Location: India
Online Status: Offline
Posts: 4
Quote j_tush Replybullet Posted: 20 Oct 2009 at 12:06pm
sir I'm sending formula I'm trying to use. Please check it :
whileprintingrecords;
numbervar array MyArray;
numbervar trial:=sum({@RebillOrderCount}, {Order.CreateDateTime}, "daily");
numbervar Counter:= count({Order.OrderID});
numbervar tushar;
numbervar total;
numbervar i:=1;

Redim Preserve MyArray[Counter];
//For tushar := 1 To Counter Do
//(MyArray[tushar] := trial*{OrderProduct.ProductPrice};
//
//)

While i < Counter Do
(
MyArray := tonumber(trial * {OrderProduct.ProductPrice});
i := i + 1;

total:= sum(MyArray);
myarray;
//Local StringVar MyArray;
//ReDim MyArray[6];

)

it might show u what i'm trying to do

thanks and regards,
Tushar Jindle
Tushar Jindle
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2009 at 3:04pm
lockwelle?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Oct 2009 at 6:22am
I am not an array expert, but from a programming side, it would appear that you are not incrementing the array counter, so you are just constantly reassigning the values to the same array member. 
 
If I wrong about the above, then you are over summing your total. 
 
This is what I would think that you are doing:
 
whileprintingrecords;
numbervar trial:=sum({@RebillOrderCount}, {Order.CreateDateTime}, "daily");
total:= total + tonumber(trial * {OrderProduct.ProductPrice})
 
trial is a fixed number, the array is never incremented, and total is summing just the 1 value, so you are doing alot of work for nothing.
 
Is this the number that you are getting?  If you want the running total, it should work now, as you are adding to the shared variable, not just constantly reassigning it with the last value.
 
Let us know how this works for you.
 
 
IP IP Logged
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