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

Summarizing a shared amount in main report 2

Status
Not open for further replies.

c15bm

Programmer
May 29, 2003
10
CA
Obtaining a total from the subreport in the Group3 Footer
section (main report and subreport share the same 3 breaks)
but with different tables (records not related).

I thought I could bring the total for the lowest break to the main report via a shared variable (Crystal 9) the field is invActivityAmt. And this does work and I can add the field to the amount at that break level in the main report.

So I do have what looks like valid Group 3 totals, now I want to use either the new combined total or the shared variable total to accumulate in the Group 1 or Group 2 totals.

I've tried to use the shared variable "invActivityAmt" and the Formula that holds it "F_TOTAL_LOCATION_AMT" in formulas but I get an error when I try to do the following:
summary_amt := summary_amt + invActivityAmt
or
summary_amt := summary_amt + F_TOTAL_LOCATION_AMT

I'm assuming passing back the totals from the subreport at the Group 3 level is ok, and that I should be able to use it to increment totals at the Group 1 & Group 2 levels
 
c15bm;

Although your explanation of your porblem is not clear - I think your problem lies in Crystal's 3 pass reporting system.

As subreports are one of the last objects that are evaluated - your Group 1 & 2 totals are worked out long before your subreport fires off.

I believe you will need to create a separate subreport at each group level to achieve what you want.

I hope this helps

paulmarr
 
Yeah, you can use them in outer groups.

If you posted what you tried, than it makes sense that it didn't work as you must declare the shared variable. If you didn't post entirely what you tried in the formula, please do so, don't leave it up to the imagination when it comes to errors.

The formula in the Group 3 group footer would be:

whileprintingrecords;
shared numebervar invActivityAmt;
numbervar G2Total:=G2Total+
summary_amt := summary_amt + invActivityAmt;

You would also want to reset the G2Total variable at the Group 2 Header:

whileprintingrecords;
shared numebervar G2Total:=0;

And do the same for a G1Total as well, although you could just total the G2Total variable at the G2 Footer to get the G1Total summary.

-k

-k
 
Question on parameters, I have a report with 3-4 subreports,
the subreports share similiar parameters. Is there a way to pass the parameters to the subreports rather than recreating them for each subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top