Skip to Content
avatar image
Former Member

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

Hi,

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:
WhilePrintingRecords;
Shared NumberVar CommRate := {@CommissionRateSub};

On the Main Report, I have the formula called CommissionRate with the following forumula:
WhilePrintingRecords;
Shared NumberVar CommRate;
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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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.

    Add comment
    10|10000 characters needed characters exceeded