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

Need totals from embedded subreport. 1

Status
Not open for further replies.

Jeremyjm

Programmer
Sep 3, 2004
31
US
Hello,

I have a subreport in my main report that I would like totals from and I don't have the slightest clue how to do this.

The subreport brings in three fields into my detail line. I'd like totals for each group including a grand total for the report. My report looks like this in the details section: (* fields are from the subreport and are grouped as one field)

[Customer name] [ID#] [2005 forecast] ([*YTD Sales] [*%FRCST] [*Avg GPM])

I can total the 2005 forecast because that's in the main report. I just can't figure how to total the fields being pulled over.

Regards,

Jeremy M.
Systems Administrator

Disclaimer:This person recently stepped in a pile of $#!^ and inherited a sys. admin. position. Although he has a limited knowledge base in some areas, he promises to do as much research as possible before posting. Please work with him, as he will appreciate any
 
To pass data back from a subreport, use a shared variable. For a date, put a formula field in the subreport like
Shared dateVar
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Shared dateVar
V_Today := V_Today

If it was a currency value, you'd do it differently, e.g.
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved

Note that the shared variable is only available in the section after the section which contains the subreport.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thank you, worked like a charm!

Regards,

Jeremy M.
Systems Administrator

Disclaimer:This person recently stepped in a pile of $#!^ and inherited a sys. admin. position. Although he has a limited knowledge base in some areas, he promises to do as much research as possible before posting. Please work with him, as he will appreciate any
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top