Print Page | Close Window

Non Standard Running Total - help appreciated

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7123
Printed Date: 20 Sep 2024 at 3:05pm


Topic: Non Standard Running Total - help appreciated
Posted By: PhilAJ
Subject: Non Standard Running Total - help appreciated
Date 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



Replies:
Posted By: DBlank
Date 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"


Posted By: PhilAJ
Date 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
 
 
 


Posted By: DBlank
Date 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'


Posted By: PhilAJ
Date 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
 
 


Posted By: DBlank
Date 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?


Posted By: PhilAJ
Date 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 ?  


Posted By: DBlank
Date 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


Posted By: PhilAJ
Date Posted: 24 Jul 2009 at 7:06am
Thats brilliant - all now sorted.
 
Thanks for your help - i've learnt something new.
 
Phil



Print Page | Close Window