Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formulas Post Reply Post New Topic
Author Message
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet Topic: Formulas
     Posted: 19 Jan 2011 at 4:42am
Good Morning,
 
I have written a formula that is doing some total in my detail lines.  Yes I know I can us the sum function but for reasons I will not get into I need to do it manually.  I believe my formula is working but I it is not adding to my total until it sees the group change which in Crystal is after the group footer.
 
So I have two questions:  1)  Can I somehow tell in a formula that I am in a group footer?  or 2) if I pass my variables to the group footer they are all showing zero.  Either I am not passing them correctly (I am just redeclaring them and they all have a scope of global) or somehow something is getting messed up with the multiple passes in Crystal.  Does anyone know how to force them to happen in the right order?
 
Thanks!
 
Dale
Thanks :)
dkalsow
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Jan 2011 at 3:13am
just to make sure, redeclaring means putting something like:
global numbervar aVar;
 
at the top of each formula, right?  If so, you are doing things correctly.
 
A don't know of a way to determine, programmatically, where the formula is, but if you place it in the group footer, that is where it will perform its work.  Typically, if I am manually summing something, I tend to put my incrementing formula in the detail section (even if it is suppressed), then the display formula can go wherever it is needed (usually a group footer) and the reset formula can go where it is needed (usually a group header).
 
To debug formulas, I will display them on the report, typically I hide the results of the incrementing/resetting, this way I can verify if they are operating correctly.
 
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