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

Total a shared variable in a main report 3

Status
Not open for further replies.

manutd1313

Technical User
Jun 26, 2002
3
US
Hi,

Forgive me, I'm new to Crystal and in a bit of time crunch. I have a main report that is grouped by Financial Hierarchy (group header 1), then funding account (group header 2). I have one subreport that gives me totals by funding account. I'm using shared variables to pass those totals to the main report. Now I need to sum those totals by financial hierarchy group.

subreport formula:
whileprintingrecords;
shared currencyvar shared_forecast :=Sum ({REPORT_BASE_MKTG_ACTS.AFA_FY_FORECAST}, {REPORT_BASE_MKTG_ACTS.FA_FUNDING_ACCOUNT_ID})

main report formula:
whileprintingrecords;
shared currencyvar shared_forecast;
shared_forecast;

The subreport resides in group header 2 and main report formula resides in group footer 2.

I'd like to have the total appear in group footer 1. Any thoughts would be extremely helpful
 
Good explanation. Change your main report formula to:

whileprintingrecords;
shared currencyvar shared_forecast;
currencyvar sumx := sumx + shared_forecast;
shared_forecast

Then in the group #1 footer use this formula:

whileprintingrecords;
currencyvar sumx;

In the group #1 header, use a reset formula:

whileprintingrecords;
currencyvar sumx;
if not inrepeatedgroupheader then
sumx := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top