Passing values from SubReport to Main report

I have searched the forums and tried almost everything that I have read and I just can’t seem to get mine to work.

I have sale price in the sub report and I want to print it in my main report. I have linked my sub report to my main report based on a variable.
My main report has a String of 14 characters long where the first 6 characters are the customer number and the last 8 are the item number.
I have a variable in the Main report as Right(custitem,8) that give me the item number that I am using to join to the sub report.
In the sub report I set up the following formula:
WhilePrintingRecords;
shared NumberVar SalePrice := {TableName.SalePrice};

In the Main report I am calling the shared variable as:
WhilePrintingRecords;
Shared NumberVar SalePrice;
I have tied all the possibilities, displaying data in the header footer.
I checked if the parameter is being passed correctly and it works. I see data correctly for the item number that I am passing but I am not able to use the same value in my Main report.
Please shed some light if you have got any ideas. It will be greatly appreciated.

Thanks!


smekala (BOB member since 2009-12-03)

Can you tell, Where you have placed your subreport in main report? and where you have placed the shared variable in main report?


anil.ganga1 :us: (BOB member since 2007-07-04)

I have my values passing between the subreports to the main report, however, if the subreport result is null, then the main report will display the previous result. How do I keep the main report from showing an incorrect result when the subreport is null?


JodiKelly :us: (BOB member since 2009-11-10)