Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Field cannot be summarized Post Reply Post New Topic
Author Message
jbrandes99
Newbie
Newbie


Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 17
Quote jbrandes99 Replybullet Topic: Field cannot be summarized
    Posted: 02 May 2011 at 11:26am
Hoping someone can help me with this. I have a formula that is working correctly and can total by Group, but I am having trouble getting a grand total out of this. I get the "This field cannot be summarized". The formula is not available in the data source so I had to create a formula in Crystal.
 
IF {billing_frequency} like "*quarter*" THEN
{#RTotal1}/3 else if {billing_frequency} like "*2-Annual*" Then {#RTotal1}/6 Else if
{billing_Frequency} like "*yearly*" then {#RTotal1}/12
ELSE
{#RTotal1}
 
Any suggestions would be appreciated.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 May 2011 at 3:55am

add a shared variable and local variable to the formula:

shared numbervar grandTotal;
local numbervar thisLine;
 
set each case to the local variable, for example:
ELSE
  thisLine := {#RTotal1}
 
update the shared variable
grandTotal := grandTotal + thisLine;
 
display the local, as that is what is desired from this formula
thisLine
 
 
to display the grand total on the report, create a formula:
shared numbervar grandTotal;
grandTotal
 
 
What you are doing is creating your own running total and then displaying the results at the end of the report.
HTH
IP IP Logged
jbrandes99
Newbie
Newbie


Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 17
Quote jbrandes99 Replybullet Posted: 05 May 2011 at 5:55am
This sounded much easier than I am finding it. Using Local and Shared variables is a first for me.
 
When I try this, I get zeros:
 
shared numbervar grandtotal;
local numbervar thisLine;

IF {frequency} like "*quarter*" THEN
thisline/3 else if {frequency} like "*2Annual*" Then thisline/6 Else if
{frequency} like "*yearly*" then thisline/12
ELSE
thisline

I know I must be missing something simple..HELP!
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 May 2011 at 8:01am
local numbervar thisLine;
shared numbervar grandTotal;
 
IF {billing_frequency} like "*quarter*" THEN
  thisLine:={#RTotal1}/3
else
  if {billing_frequency} like "*2-Annual*" Then
    thisLine:={#RTotal1}/6
  Else
    if {billing_Frequency} like "*yearly*" then
      thisLine:={#RTotal1}/12
    ELSE
      thisLine:={#RTotal1};
 
grandTotal := grandTotal + thisLine;
thisLine
 
 
set the value that you want to the local variable,
set the grand total to keep a running total of the values
 
in another formula, display the grand total:
shared numbervar grandTotal;
grandTotal
 
HTH
IP IP Logged
jbrandes99
Newbie
Newbie


Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 17
Quote jbrandes99 Replybullet Posted: 05 May 2011 at 9:18am
Worked perfectly! Thanks you!!!
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.