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!

Shared Variable

Status
Not open for further replies.

bld21

Technical User
Mar 1, 2010
49
US
I am using crystal reports 2008.

In my main report in the report footer I have a grand total formula for:

if IsNull (Sum ({@adj_amt})) then Sum ({payment.pmt_amt})
else Sum ({payment.pmt_amt}) + Sum ({@adj_amt})

I have a subreport after that in report footer b that is summing other pmt amounts.

I want the subreport to pass and add this total of pmt amounts to the grand total in the main report.

Any help is greatly appreciated.

Bruce D.

 
In the sub, set up a shared variable to be placed in the report footer:

whileprintingrecords;
shared numbervar subamt := {@yoursubreportcalc};

In Report footer_c, reference it in a calculation:

whileprintingrecords;
shared numbervar subamt;
subamt + (
if IsNull (Sum ({@adj_amt})) then Sum ({payment.pmt_amt})
else Sum ({payment.pmt_amt}) + Sum ({@adj_amt})
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top