Print Page | Close Window

Sum of a Formula and Sum of Records Sorted by a Gr

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=19372
Printed Date: 03 May 2024 at 10:12am


Topic: Sum of a Formula and Sum of Records Sorted by a Gr
Posted By: Yosteevo777
Subject: Sum of a Formula and Sum of Records Sorted by a Gr
Date 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



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


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



Print Page | Close Window