Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grand total using formula problem Post Reply Post New Topic
<< Prev Page  of 2
Author Message
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 07 Jul 2010 at 8:53am
I'm using variables to calculate a formula, field X.  However, I can't insert a summary on field X or any field that references field X.  Any ideas?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 07 Jul 2010 at 9:44am
You would need to create your own summary.  (i.e., x := x+ value, at the detail section, show x at the report footer section).
IP IP Logged
cyber-guys
Groupie
Groupie


Joined: 02 May 2008
Online Status: Offline
Posts: 42
Quote cyber-guys Replybullet Posted: 07 Jul 2010 at 10:30am
SmileMy final resolution was using global variables - I did it in 3 formulas, initialize, collect first set of data, totalize data
 
Thanks for the help,
Cyber-guys
IP IP Logged
candace
Newbie
Newbie


Joined: 12 Jan 2010
Location: United States
Online Status: Offline
Posts: 11
Quote candace Replybullet Posted: 07 Jul 2010 at 12:30pm
Thanks for your help! I think I'm confused on how to use your suggestion to get what I need. 
 
I've created a formula to house the custom summary.  I don't know if it makes a difference, but I don't want to add a value to that, so it essentially just references the original formula {@commission new}.
 
The custom summary looks like this:
WhilePrintingRecords;
Global currencyvar commissionnewSUM:= {@commission new}
 
I have placed that in the 'details section' which is actually a group header, details on this report are suppressed.
 
I've got a display variable field which I've placed in the master group header, but it shows $0.00. 
 
WhilePrintingRecords;
Global currencyvar commissionnewSUM
 
I don't understand how to write it so that it totals the {@commission new} field for a set of records in the group.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Jul 2010 at 3:06am
variables don't do well in group headers...CR needs to read the data first to populate the variable...and it hasn't done so in the group header (well only the first record, but that is not what you are after).  If you are intent on having the formula in the group header then you need to run a subreport and using shared variables report back the number that you want to display (shared variables cross the line between subreports and main report).
 
HTH
IP IP Logged
<< Prev Page  of 2
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.