Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Sum of a Formula and Sum of Records Sorted by a Gr Post Reply Post New Topic
Author Message
Yosteevo777
Newbie
Newbie
Avatar

Joined: 23 Apr 2012
Location: United States
Online Status: Offline
Posts: 33
Quote Yosteevo777 Replybullet Topic: Sum of a Formula and Sum of Records Sorted by a Gr
    Posted: 05 Apr 2013 at 4:30pm

Subject:   Sum of a Formula and Sum of Records Sorted by a Group Sort

 

 

 

I am using Crystal Reports 2008.

 

1)      I have a subreport where I need to calculate the sum of the output of a formula that outputs a numerical result.

 

2)      In this subreport I have a group configured that sorts data by one database field.  I configured the group sort to go to a new page for every single new record it reads.  I need to have the ability to count how many times this group produces a new page (count the number of records the group sort reads through).

 

 

Thank You.

Stephen Waichulis

Stephen Waichulis
LIMS Database Administrator
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 09 Apr 2013 at 2:50am
I would use a shared variable in the formula. Everytime the new page condition is triggered I would increment the counter.
 
Depending on where you are displaying this value, you might want to use a global variable.  If the count is only going to be used in the subreport, I would a global variable, as it is only seen by the subreport, so I am pretty sure will reinitialize each time the subreport is run to 0.
 
If you use a shared variable, it might retain its value between calls to the subreport...unless that is what you want.
 
HTH
IP IP Logged
Yosteevo777
Newbie
Newbie
Avatar

Joined: 23 Apr 2012
Location: United States
Online Status: Offline
Posts: 33
Quote Yosteevo777 Replybullet Posted: 09 Apr 2013 at 12:13pm
Hello HTH,

Can you give an example of the counter syntax you are thinking of.

Thanks




Stephen
Stephen Waichulis
LIMS Database Administrator
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.029 seconds.