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!

Adding Summary total from subreport to main report formula

Status
Not open for further replies.

davismar

IS-IT--Management
Apr 1, 2010
85
US
Using Crystal XI - I am trying to add a total from a subreport to the main report.

The value in the subreport is actually a total summary field.
How can I add this value to the main report?

See following attachments:
1. SHR Main Report wSub (Note: This is the MAIN Report)
2. Subreport Sum T&MDiff Total (the figure of $600.00) on the main report to be added to the below item # 3 under T&M Charge Total.
3. Formula for T&M Charge Total (need to include the value from attachment # 1 above).
 
I can't tell where the sub is located in the main report, but if you want to use the value in a grand total in the main report, you will need to share the value in a variable. In the report footer of the sub, add a variable like this:

whileprintingrecords;
shared currencyvar sumTMDiff := sum({@T&MDiff});//assuming the sub is linked on the group field and the sub is placed GH_a (above where you want to display the results)

In the main report, you can display the results by using a formula like this in GH_b (or in a section below the one containing the sub):

whileprintingrecords;
shared currencyvar sumTMDiff;

If you want to add it to other values, then use a formula like this:

whileprintingrecords;
shared currencyvar sumTMDiff;
sumTMdiff+sum({table.value},{table.invoice})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top