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

Crystal 9 - shared variables passing from subreport 1

Status
Not open for further replies.

c15bm

Programmer
May 29, 2003
10
CA
I have a main report that suppresses the detail records, basically showing summaries of consumption data by location_code, unit_name & facility_name. Some of the consumption data is in a separate table, the records are not related to the main table in the main table - thus a subreport.

I have written the subreport to summerize the amount (consumption only) by location_code, unit_name & facility.
I then suppressed all but the location_code total.

I want to pass that back to the main report to include in the location_code subtotals.

I've created formulas to define the the shared variable to pass the data, but it always comes up "false".

in Subreport:
WhilePrintingRecords;
Shared numberVar invActivityAmt;
invActivityAmt = Sum ({INVENTORY_ACTIVITY.AMOUNT}, {INVENTORY_ACTIVITY.SOURCE_INVENTORY_LOCATION_CODE});

in Main report:
WhilePrintingRecords;
Shared numberVar invActivityAmt;
invActivityAmt;

For now, I just wanted to display the value before using it in a formula. Shows up as "False" in the Subreport and "0.00" in the main report.

I have the subreport placed in the Group Header 3 - Location Code group and the resulting formula (main report) in the Group 3 footer.

Any help would be appreciated.
 
c15bm

Modify your subreport variable with colon as below to get rid of the "false"


//in Subreport:
WhilePrintingRecords;
Shared numberVar invActivityAmt;
invActivityAmt:= Sum ({INVENTORY_ACTIVITY.AMOUNT}, {INVENTORY_ACTIVITY.SOURCE_INVENTORY_LOCATION_CODE});

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top