Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR11 Need to display subreport grand total on Main Report 1

Status
Not open for further replies.

azoe

Technical User
Feb 21, 2005
175
US
I've been reading thread149-1001035 because it sounds very similar to my issue but I must have something wrong because I'm getting a zero in the main report.

I have a main report of employees tasks. It is grouped on their last name, then the task description. It is based on a stored procedure that shows totals for tasks open, in progress and completed for whatever dates the user picks.

Then I have a subreport based on a stored procedure that pulls all open tasks and tasks in progress with no date restraint. It is in GF1a of the main report.

I linked them by last name.

In the subreport detail section I placed this formula:
//TotalCountShared
whileprintingrecords;
shared numbervar TotalCount:=Sum({@TotalOpen})

(Here's the TotalOpen formula:)
If {aa_dch_TaskListAllOpen;1.status} = '1'
or
{aa_dch_TaskListAllOpen;1.status} = '3'
Then 1
Else 0
//3 is in progress
//1 is not started

Then in the main report GF1B I have a formula:
//SumTotalOpenShared
whileprintingrecords;
shared numbervar TotalCount;
numbervar SumTotalCount:=SumTotalCount + TotalCount;

Then in the main report footer I have formula:
//DisplayTotalOpenShared
whileprintingrecords;
shared numbervar SumTotalCount;

Then, just in case there's a null, in the GF2b I put this formula: (I've tried it with and without this formula)
//ResetTotalcountShared
whileprintingrecords;
shared numbervar TotalCount:=0;

I did a grand total in my subreport but it doesn't display once I insert it into the main report. So I thought I would need to do these formulas to pass the value to the main report. All I'm getting is a zero.

Can anyone see where I've gone wrong?
Thank you -
 
Place the {@TotalCountShared} formula in the subreport report footer, and place {@ResetTotalcountShared} in the Group Header #1. Also, make sure you have not hidden or suppressed GF#1a.

-LB
 
That was it - I misplaced those two formulas.
Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top