Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Non Standard Running Total - help appreciated Post Reply Post New Topic
Author Message
PhilAJ
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 28
Quote PhilAJ Replybullet Topic: Non Standard Running Total - help appreciated
    Posted: 22 Jul 2009 at 10:55am
I have a report to create that is driving me nuts.
 
To make it simple, there are a number of records, each with a 'Code' Field, and also a value field. One of the codes is 'DOOR' and records containing these are present throughout the data, EG
 
DOOR    2
XXXX     3
yyyy      4
aaaa     1
DOOR    2
SSSS     3
YYYY      2
DOOR    2
qqqq     4
 
 
etc....
 
WHat I need to do is show a sub total for each set of records starting with DOOR - so in effect it show;
 
DOOR    2
xxxx      3
yyyy      4
aaaa     1
      SUBTOTAL 10
 
DOOR    2
SSSS     3
YYYY      2
      SUBTOTAL  7
 
DOOR    2
qqqq     4
      SUBTOTAL 6
 
 
I've tried to use GROUPS but can't as there isnt anything to group on
 
I've tried to use Running totals - but can't reset them as no group
 
I've even tried using formulas and putting them onto different parts of the report, resetting etc, but have got totally confused with it.
 
I tried to show the Running Total on the top of the next DOOR detail ine - but then cant reset it to zero.
 
ANy help will be greatly appreciated
 
Thanks
 
Phil
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Jul 2009 at 11:10am
Use a running total
Field to summarize=number field from above
type=SUM
evaluate = for each record
reset =Use a formula ... {table.field}="DOOR"
 
You can place the RT on a detail B and conditionally suppress that section as:
next(table.field} <> "DOOR"
IP IP Logged
PhilAJ
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 28
Quote PhilAJ Replybullet Posted: 23 Jul 2009 at 9:28am
Thanks for response DBlank
 
Not sure if I understand you correctly though. I've created a formula called RESETRT containing;
 
If {sicsp_SOP_Documents;1.Detail Product Reference} = 'DOORS'
then {#RTotal0} = 0
 
and have put this onto a new Detail Section....ir shows up as a 'false' if printed but doesnt reset the RTotal
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 9:32am
You do not need to create a fomula field to reset a Running Total (as with a variable).
Right click o you existing RT and select Edit
The last part of the RT is called RESET and it gives you 4 toggle options. Select use a formula and click on the x-2 button (it will activate when you select that toggle botton).
in there put your reset formula ( a true / false option) as:
{sicsp_SOP_Documents;1.Detail Product Reference} = 'DOORS'
IP IP Logged
PhilAJ
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 28
Quote PhilAJ Replybullet Posted: 23 Jul 2009 at 10:00am
Thanks - this works great for resetting the values...
 
BUT - I need to show the total just before its reset..as in a sub total like above....
.if I show the extra Detail line it shows after every other detail line..
If i Suppress on all except when it is DOOR then it has reset the value before it prints so always shows 0
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 10:12am
Yep. That is why I recommended to conditionally suppress details section B with :
 
next(sicsp_SOP_Documents;1.Detail Product Reference} <> "DOOR"
 
Does that solve the display issue?
IP IP Logged
PhilAJ
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 28
Quote PhilAJ Replybullet Posted: 23 Jul 2009 at 10:22am

Sorry - I didn't twig the word 'Next' - never used that before and didn't know it existed. This works great thanks...

Except - the last sub total doesnt show. ANy magic for this ?  
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jul 2009 at 10:30am
Change the suppression condition to account for that by including not onlastrecord:
(sicsp_SOP_Documents;1.Detail Product Reference} <> "DOOR"
or
not onlastrecord
IP IP Logged
PhilAJ
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 28
Quote PhilAJ Replybullet Posted: 24 Jul 2009 at 7:06am
Thats brilliant - all now sorted.
 
Thanks for your help - i've learnt something new.
 
Phil
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.