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

Group totals on shared variables from subreports

Status
Not open for further replies.

gillf

Technical User
Aug 14, 2002
35
GB
My report is to show costs on a building contract. Because of table linking problems, I'm having to use 3 subreports to show the detail lines of my report. I have no total on the subreports, but variables as shown below.
The main report is grouped by Contract No (GH#1), then Section1 1(GH#2), Section2(GH#3) and Contract item reference (GH4)
The subreports are in Group footer #4a, b and c and the subreport footers contain the following variables:
WhilePrintingRecords;
Shared NumberVar PITOTAL := Sum ({@PI POS/NEG});

WhilePrintingRecords;
Shared NumberVar NTTOTAL := Sum ({Ccs_O_Nominal_Detail.CCS_OLD_COST_VALUE});

WhilePrintingRecords;
Shared NumberVar TSTOTAL := Sum ({Ccs_O_Ts_Detail.CCS_OLD_LAB_PRICE});

In the container report - section #4d I have the formula:
WhilePrintingRecords;
Shared NumberVar Tstotal;
Shared NumberVar PItotal;
Shared NumberVar NTTotal;
PItotal+TStotal+NTTotal

This bring through correctly the combined totals of the sub-reports, but I don't want to display it at that level - instead, I need 2 group totals on the main report in GF #2 and GF #1, as well as a report total.

I should appreciate advice!
 
In Crystal 8.5, values from subreports do not exist within Crystal until after Crystal has printed the section containing the subreport. That limits what you can do with it.

A work-round is to include the subreport twice, the first time as an invisibile version that does not appear but does return values that the main report can then print.

Madawc Williams
East Anglia, Great Britain
 
Thanks Madawc. I'm on version 9 - and I do get values returned but only at the one level.
If I use a formula in the main report to add that data to itself (which I've seen on a post to pomster from synapsevampire), I get zeros.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top