Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Counting results in sub reports Post Reply Post New Topic
Author Message
Yamisquiff
Newbie
Newbie


Joined: 23 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Yamisquiff Replybullet Topic: Counting results in sub reports
     Posted: 18 Aug 2009 at 1:51am
Dear All,

If possble can you perform distinct counts of items that are contained within a sub report on the main report, the sub report I have repeats and generates results for each and every record the report pulls from the database.

It's driving me crazy on how I get round this, am not too wonderful with Crystal Reports and have kind of been thrown in the deep end by my firm.

Look forward to hearing your suggestions,

Cheers,

Warren
IP IP Logged
ravikumarmittal
Newbie
Newbie


Joined: 11 Aug 2009
Location: India
Online Status: Offline
Posts: 3
Quote ravikumarmittal Replybullet Posted: 18 Aug 2009 at 4:34am
hi, you can count record in your sub report by using the shared variables.
 
in your main report declare one shared variable suppose icount=0;
in sub report declare same variale icount it should also be shared.
 
after the sub report section print the icount variable .
IP IP Logged
Yamisquiff
Newbie
Newbie


Joined: 23 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 10
Quote Yamisquiff Replybullet Posted: 08 Oct 2009 at 7:06am

Thanks for the reply.

 
I have managed to get the shared variable working. However I now have another problem
 
I have a formula that sets a formula value to either 0 or 1 every time a record meets a speicifc criteria.
 
I want to total up to number of 1's that are returned.
 
the formula works as follows:
if {@Info Closed In Time} = "YES"
then
WhilePrintingRecords;
Shared NumberVar CounterYES := +1;
 
Every time the group is ran this places a 1 on each record set that is returned with a YES and a 0 on those returned with a NO.
 
I want to add up all the 1s and then display this information on my main report.
 
Any suggestions?
 
Warren
 
 
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