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

Passing data from subreport to main report

Status
Not open for further replies.

csm2

IS-IT--Management
Dec 6, 2000
84
US
I am trying to pass subreport formula results to main report formulas using shared variables. The data from subreport is not being added to main report formula.

Main report formula:
Shared numberVar AllTotJanInd;
{@AllJanField}+{@AllJanTravel}+AllTotJanInd

The formulas in the subreport are in the Report Footer and RF is suppressed. If I unsuppress RF, then the results display correctly in the main report, but the main formula adds only AllJanField and AllJAnTravel.

I am using CR 7, Win95 and Informix DB.
 
The old bug bear of sub-reports/container reports. Try the Seagate knowledge Base c2007600 which deals specifically with linking shared variables between container/sub-reports.
 
After you have read the article if you need further help answert these:

Where is the formula located in the main report? Where is the subreport located?
What is the formula in the subreport? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
After reading c2007600, I made changes to my formulas (added WhilePrintingRecords stmt and adding a subsection). The problem remains; main formula still does not add the result of SR formula.

Ken,
The report layout is as follows:

Page Header TEXT TITLES
Jan Feb ---------> Dec
Group Header TEXT
subreport A Formula -------------> Formula
Group Footer TEXT Formula ---------------> Formula
TEXT Formula ---------------> Formula
TEXT Formula ---------------> Formula
TEXT Formula ---------------> Formula
Report Footer a
TEXT
subreport B @allJanClinic ---------> @AllDecClinic
TEXT @AllJanTravel -----------> @AllDecTravel
TEXT @AllJanField ------------> @AllDecField
TEXT @JanAvg ---------------> @DecAvg
Report Footer b
TEXT @AllTotJanMandays -------> @AllTotDecMandays

Subreport B is the one I am having problems with.
@AllJanClinic thru @AllDecClinic display correctly. They are calculated in Subreport B.
@AllxxxTravel & @AllxxxField are calculated in main report.

The main report formulas is: @AllTotJanMandays
WhilePrintingRecords;
Shared numberVar AllTotJanInd;
{@AllJanField}+{@AllJanTravel}+AllTotJanInd


The subreport formula is: @AllJanIndirect
WhilePrintingRecords;
Shared numberVar AllJanInd := round({#AllJanIndirect}/420);
 
Hey guys!
Any ideas? My project is dying here.
Pleeeease!
 
OOOOPS! Eyeball check. Thanks Ken. Those variables are and should be different. I've been looking at hose suckers for so long that if somebody changed them to Chinese, I wouldn't have noticed. :-O
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top