Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summarise fields Post Reply Post New Topic
Author Message
s2ymon
Newbie
Newbie


Joined: 08 Nov 2010
Online Status: Offline
Posts: 3
Quote s2ymon Replybullet Topic: Summarise fields
    Posted: 08 Nov 2010 at 4:29am
Hi, got a report and have to summarise a formula field which when i use sum option it's showing that it can't be summarized. Report is fetching information from database about how many products haven't been send to customer previous day(shorts) and compares it with our stock on each product to determin wheter production needs to produce some of that product or wehave stock on it and it can be dispatched straight away.The field i want to summarize is in the group footer and it's name is: shortstotal with a formula in it:
IF ({@brittotalbyproduct} + {@scototalbyproduct} - {usr_Report_Production_Shorts;1.qty}<=0)
then
(
0
)
else
(
{@brittotalbyproduct} + {@scototalbyproduct} - {usr_Report_Production_Shorts;1.qty}
)
 
field. It basically checks wheter there is enough stock in the warehouse to dispatch it (if yes than shorts = 0 as production doesn't have to produce any of it to cover shorts, if not than it calculates how many of that product needs to be produced). It's in group footer because in details there is  few different fields which i use to determin wheter products a british or scottish and i can't move it into details area.
 
I know there is a 3 step formula which can be set to calculate but all examples i found didn't work for me or i'm doing something wrong so please help and give me some advice how to summarize it.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Nov 2010 at 6:37am
standard steps :
1 - reset variable to 0
2 - increment variable
3 - display result.
 
in your case in the group header, reset
shared numbervar aVar := 0;
 
increment the group footer (just add into your example above)
shared numbervar aVar;
local numbervar thisVar;
IF ({@brittotalbyproduct} + {@scototalbyproduct} - {usr_Report_Production_Shorts;1.qty}<=0)
then
(
0
)
else
(
  thisVar := {@brittotalbyproduct} + {@scototalbyproduct} - {usr_Report_Production_Shorts;1.qty};
 
  aVar := aVar + thisVar;
  thisVar
)
 
finally, display (in report footer??)
shared numbervar aVar
 
HTH
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.