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

Transferring shared variable from subreport to main report

Status
Not open for further replies.

JudyL

Instructor
Feb 21, 2001
148
US
I have a report that is linked to a main report by the grouping value in the main report. I want to get the latest time and the earliest time from the detail in the subreport and display that in the main report.
This is the formula:
WhilePrintingRecords;
Shared stringVar vEarlyECGStrip;
if{ecg_defib.ecgr_time}=Minimum({ecg_defib.ecgr_time})then
vEarlyECGStrip:={ecg_defib.strip}

The subreport is placed in the group header. It is linked to the main report on the grouping item. That all works fine. It lists all the items in the detail and in another column, displays the highest value and the lowest value.

The group has multiple headers. The subreport is in one of those. In an earlier header for the same group, I want also display the same values but it is bringing in the earlier groups value.

So for the same group but in different headers for the group, I am getting two different values.
 
Your formula should probably be in the groupfooter as:

WhilePrintingRecords;
Shared stringVar vEarlyECGStrip :=Minimum({ecg_defib.ecgr_time},{ecg_defib.groupfield})

Hard to know for sure.

Rather than explaining the things that don't work, try posting example data and the required output.

-k
 
Put the subreport in the topmost groupsection (or create a new group section_a), and then reference the results in a formula in a later group section, e.g.:

WhilePrintingRecords;
Shared stringVar vEarlyECGStrip;

You can suppress all sections within the subreport, format the subreport to "suppress blank subreport", and then also format the group section to "suppress blank section". Then the section the sub is in won't show, but you can use the shared variables for later display.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top