Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Subtotaling/Running Totals in Groups Post Reply Post New Topic
Author Message
barfnuts
Newbie
Newbie
Avatar

Joined: 11 Sep 2008
Location: Canada
Online Status: Offline
Posts: 4
Quote barfnuts Replybullet Topic: Subtotaling/Running Totals in Groups
     Posted: 12 Apr 2010 at 1:33pm
Hello everyone,

I was hoping the function I need would be possible in Crystal Reports 8.5.

I have a purchasing report that groups parts that need to be ordered by part number. Inside that component part number is a list of different production orders that the part is allocated to. This report takes the quantity currently on hand, subtracts the quantity needed for the production order, and specifies when parts need to be re-ordered based on lead times.

The problem I seem to be having is that I can't figure out how Crystal handles equations on items in a group.

It's kind of hard to explain so below is a link to a screencap of my report:
http://www.mediafire.com/i/?ggymmngdzdn

Under the heading "On Hand", I want the value of "Qty Required" to subtract the amount "On Hand" progressively through each line and display to the right of the "Qty Required" value. For example:

Line 1 - Qty Req'd: 75 // On Hand: 35   Total: 40
Line 2 - Qty Req'd: 75 // On Hand: -5    Total: -5
Line 3 - Qty Req'd: 50 // On Hand: -40   Total: -45

The reason I want this is so that if the "Total" number is below 0, it would trigger the "Order By" column so that the purchaser is aware they need to be ordered.

Is this possible? Would I use some sort of a running total field? My knowledge of Crystal is still "in progress" so any help would be greatly appreciated.


Thanks!



Edited by barfnuts - 12 Apr 2010 at 3:24pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Apr 2010 at 3:32am
DBlank uses running totals, I like formulas, they both end up doing the same thing.
 
for formulas, you will need 3, maybe 4.  1 to set the variable to number on Hand initially usually in the group header:
shared numbervar OH:={table.field};
""//to hide the number
 
1 to increment/display
shared numbervar OH;
shared numbervar Old:=OH;
OH:=OH - {table.QtyNeeded};   //this is for the right most column
Old   //displays the On Hand amount
 
1 to display the 'new' value
shared numbervar OH;
 
The trick is the old vs the new on hand value, and if this doesn't work(if CR evaluates the formulas in a random way--not left to right on the page) then a separate suppressed detail section above the main detail section might be a solution.
 
You could easily interrogate the variables and from them determine if you need to trigger the order by column.
 
HTH
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