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

Subreport group totals in main report group

Status
Not open for further replies.

RDRaider

MIS
Nov 5, 2009
9
US
Hi all,
I have a Crystal 10 report with a subreport. The main report has 3 groups with totals for each group. The subreport is identical, the difference is the where the data comes from.
The subreport is placed in the main reports footer (report footer a).
I added variables to pull the sub-report grand totals into the main report (report footer b). This works, I imagine, because the sub-report is evaluated before the subreport totals are used in the main report.

What I need is to take totals from each group on the subreport and use them in the corresponding group on the main report. This give me 0.00. I would assume this is because the subreport has not yet been evaluated since it is in the main reports footer? Is there a way to use the subreport groups totals in the main report groups? Does the EvaluateAfter function useful here?

Thanks.
 
Not sure what is being displayed in the sub or whether the sub is meant only to provide totals. Depending on the answer, you could either move the sub to the group section and link it on the group field and then use shared variables for the group level calculations and then sum shared variables to get the report level summaries, or you might want to add a separate copy of the sub to the group section. But no, you can't access results from a sub in the report footer in an earlier section.

-LB
 
I was not the original author of the report but it looks like it needs a re-write. I tried moving the subreport to the main report header. Now, the subreport group variables pass values to the main groups but the value are just the last value the variable held.
I will re-do with subreports for each group section.

Thanks.
 
You only need one subreport in a group section, just link it on the groupfield. Place it in a group section above the one in which you do the calculation.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top