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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In Main Report Creating a summary for passed fields from subreport 1

Status
Not open for further replies.

PDAnalyst

Technical User
Dec 2, 2005
72
US
Hi,

I have created a CR 9.0 report that passes two variables (num of units and total number of minutes that these units spent) to the main report. I then wanted to create a running total field for each group of records (based on priority codes). CR does not allow me to use a sum function for these passed variables for the group summaries. I have then tried to create a running total formula but this does not discern any of the groups and gives me a grand running total for all of the groups.

Any help will be appreciated.

Thanks



Here is the formula for the NumUnits
WhilePrintingRecords;
Shared NumberVar NumUnits;
NumUnits

Here is the formula for the Total number of minutes spent:
WhilePrintingRecords;
Shared NumberVar UnitGrandTotal;
UnitGrandTotal

 
In the main report, create these formulas:

//{@reset} to be placed in the main report group header:
whileprintingrecords;
numbervar sumnumunits := 0;
numbervar summins := 0;

//{@accum} to be placed in a section below the one in which the subreport is firing. If the subreport is in detail_a, then place this in detail_b:

whileprintingrecords;
shared numbervar NumUnits;
shared numbervar UnitGrandTotal;
numbervar sumnumunits := sumnumunits + NumUnits;
numbervar summins := summins + UnitGrandTotal;

//{@displunits} to be placed in the group footer:
whileprintingrecords;
numbervar sumnumunits;

//{@displmins} to be placed in the group footer:
whileprintingrecords;
numbervar summins;

If this isn't what you are looking for, you need to describe your main report group structure, specify where the subreport is located, and at where you want results.

-LB
 
Thanks lbass,


This was exactly what I was looking for.

I really appreciate your help. You saved me from hours of headache,

SE

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top