Link to home
Start Free TrialLog in
Avatar of Sue Taylor
Sue TaylorFlag for United States of America

asked on

Calculated field based on subreport ... AGAIN

I thought this was working correctly, but it's not.  I'm having difficulty getting a field from my subreport and using it in a formula in my main report.

In my subreport, I have a formula called Subreporttotal in the Group Footer #1, that is :
WhilePrintingRecords;
Shared NumberVar SubreportTotal;
SubreportTotal := Sum({Command.ext_recvd}, {Command.vendor_id});

In my main report I have formula called SharedNumberVar that is in the report header that is:
WhilePrintingRecords;
Shared NumberVar SubreportTotal;

In my main report, I have a formula called Impact %, that is in the Group Footer #1 @ Vendor - A section that is:
WhilePrintingRecords;
Shared NumberVar SubreportTotal;
If SubreportTotal = 0 then
    0
Else
    Sum ({@Total NC Cost}, {@Vendor}) / SubreportTotal


When I run the report, I get zeros everywhere and I can't figure out what I have done wrong.
Vendor-Issues---Summary.rpt
Vendor-Spend-Subreport.rpt
Vendor-Name-Subreport.rpt
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sue Taylor

ASKER

Thanks so much!  I will add all of your help to my 'help file' for future reference.   This was my first report with variables.....I learned a lot from you.