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!

subreports... friend or foe?

Status
Not open for further replies.

cmpgeek

Technical User
Feb 11, 2003
282
US
hey yall...
I have been struggling with this since I starting doing subreports this past summer...
is there ANY way to use the totals that come up in the subreport within a formula in the main report?

Ex: in my subreport i am looking for the total elapsed time patients spend in recovery after a specific procedure. In the main report i have the total # of patients that had that particular procedure. What I want, is a field that averages the time by taking the total elapsed PACU time (which would come from the subreport)and dividing it by the total # of patients who were there for that particular procedure. if this makes any sense to anyone, can you please let me know if i am wasting time on this, or if there IS a way for it to be accomplished...

thanks
 
Hi,

Use shared variables in your sub report and call the shared variable in your main report. For example you want to have a field name Pacu. If it is a number then your code in the sub report will be
Whileprintingrecords;
Shared numbervar Pacu := your calculation;

Then create a formula in the main report like @ReceivedPacu
The code will be shared numbervar Pacu; Note the sub report always should be first means before the @receivedPacu, otherwise it will return Boolean.


Thanks,
Hamida
 
One extra point. The data returned from your subreport can only be used by some later report section. You'll find the value missing if you try to use it in the same section. Madawc Williams
East Anglia
Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top