Calculate between SubReport and Report

  • Thread starter Thread starter Stacey Crowhurst
  • Start date Start date
S

Stacey Crowhurst

Hi. My report "rptProjectedCostSummaryFinal" has a subreport in the
budCCPIDFooter section "rsubCauseCodeAllocation". I would like to take a
field in the subreport divided by a field in the main report to get a
percentage.

The sub report field is:
=(IIf(IsNull([CON]),0,[CON]))+(IIf(IsNull([CO]),0,[CO]))+(IIf(IsNull([PCO]),0,[PCO]))+(IIf(IsNull([PM]),0,[PM])+(IIf(IsNull([NONCON]),0,[NONCON])))

The main report field is:
=Sum(ProjectedCosts)

I am not sure how do go about this calculation. For background the
subreport sums up cause allocations (base scope, errors & omissions, job
conditions, etc.). I would like to include what percent of total projected
costs each cause allocation is. Please let me know if you need more
information. And thank you as always for your help!!

Stacey
 
You need to reference the control name from the subreport. Try something like:
=rsubCauseCodeAllocation.Report.txtCtlName/Sum(ProjectedCosts)
This may cause issues if the subreport might not return any records. If this
is the case, you can search this NG for HasData to find a solution.
 
Back
Top