Skip to Content

Shared Variable from Details Section in Subreport to Details Section in Main Report

Nov 01, 2016 at 08:09 PM


avatar image
Former Member


I am able to grab the Details in a Sub Report to the Details in the Main Report. The field is called CommRate. On the Main Report, it shows up correctly in the Details section. Everything looks good, but how can I use that field in a calculation in the Details section in the Main Report?

I watched some videos relating to Shared Variables so am trying this:

I created a field called CommRate with the following formula:
Shared NumberVar CommRate := {@CommissionRateSub};

On the Main Report, I have the formula called CommissionRate with the following forumula:
Shared NumberVar CommRate;

I am trying to get the CommissionRate to show up on the Main Report in the Details section so I could use it as a calculation. Right now, it shows zero with these formulas I created.

Any help would be appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Toby McDonald May 24, 2017 at 07:56 PM

I would start by printing @CommissionRateSub in the subreport to confirm its value before assigning it to CommRate (ie. ensure it is not indeed zero).

If CommRate has whileprintingrecords, then I would also add whileprintingrecords; to the beginning of @CommissionRateSub formula.

10 |10000 characters needed characters left characters exceeded