Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Create totals from subreport Post Reply Post New Topic
Author Message
Nancy
Newbie
Newbie


Joined: 08 Nov 2010
Online Status: Offline
Posts: 1
Quote Nancy Replybullet Topic: Create totals from subreport
     Posted: 08 Nov 2010 at 8:38am
I have a report that I has a subreport and specific data on the subreport.
When I try to add totals to the main report, it 'shows' all of the categories but counts correctly.  I only want the specific items I want on the list.
ex: offender name --
            chronos - date
     offender name  --
           No chronos
 Only want a total of the Chronos with a date.
I have the report narrowed to the specific Chrono and date but when I do the totals it expands the report with ALLchronos and then show the count.
Help would be appreciated.Confused


Edited by Nancy - 08 Nov 2010 at 8:52am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 09 Nov 2010 at 3:28am
if the subreport is part of what you want, you can communicate between subreports and the main report using shared variables.
 
Say your subreport has a count and a flag to whether or not to include the count.
 
In the subreport:
shared numbervar aCount;
shared booleanvar aBool;
 
aCount := somevalue; //perhaps using an if statement
aBool := (true or false); //probably as a result of an if statement
 
in the main report
shared numbervar aCount;
shared booleanvar aBool;
global numbervar totalCount;
 
if aBool then totalCount := totalCount + aCount;
 
HTH
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